vuejs does not display the value within {{ }}, the text is displayed as is
P粉797004644
2023-08-30 13:36:59
<p>I developed a vuejs program and ran the <code>npxserve</code> command. I go into that directory and run npxserve. I browse <code>http://localhost:300/myvuefile.html</code> and only get the following output.
{{count}} inside the button. My code: </p>
<pre class="brush:php;toolbar:false;"><script src="https://unpkg.com/vue@3/dist/vue.global.js"></script> ;
<div id="app">
<button @click="count ">{{ count }}</button>
</div>
<script>
import { createApp } from 'vue'
const app = createApp({
data() {
return {
count: 0
}
}
})
app.mount('#app')
</script></pre>
<p>I have to get the value of the count and on click the count should be incremented. Instead, I only get {{count}} as output. Please help to resolve this issue. </p>
According to documentation- p>
So, either use -
like this