填写缺失的代码,以便用户看到文本“in stock”(有货)或“not in stock”(无库存)。
<div id="app">
<p @(4)="typewritersInStock">
in stock
</p>
<p @(6)>
not in stock
</p>
</div>
<script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>
<script>
const app = Vue.createApp({
data() {
return {
typewritersInStock: true
}
}
})
app.mount('#app')
</script>
<div id="app">
<p v-if="typewritersInStock">
in stock
</p>
<p v-else>
not in stock
</p>
</div>
<script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>
<script>
const app = Vue.createApp({
data() {
return {
typewritersInStock: true
}
}
})
app.mount('#app')
</script>