这里会显示出您选择的修订版和当前版本之间的差别。
两侧同时换到之前的修订记录 前一修订版 后一修订版 | 前一修订版 | ||
2020-2021:teams:no_morning_training:fayuanyu:test [2020/05/17 22:38] 发源于 |
2020-2021:teams:no_morning_training:fayuanyu:test [2020/05/22 17:14] (当前版本) 发源于 |
||
---|---|---|---|
行 4: | 行 4: | ||
<div id="app"> | <div id="app"> | ||
<div v-bind:title="message"> | <div v-bind:title="message"> | ||
- | 竟然敢让我用vue! | + | 我竟然能用vue! |
</div> | </div> | ||
<div id="text1"> | <div id="text1"> | ||
{{this.text}} | {{this.text}} | ||
+ | </div> | ||
+ | <div> | ||
+ | 不行,有空整个vue的模板套上去吧 | ||
</div> | </div> | ||
<button v-on:click="change"> change </button> | <button v-on:click="change"> change </button> | ||
行 16: | 行 19: | ||
data: { | data: { | ||
message: 'Hello' , | message: 'Hello' , | ||
- | text: '不是,能用原生html也太离谱了吧' | + | text: '不是,能用原生html也太离谱了吧', |
+ | bool_change: false , | ||
}, | }, | ||
methods: { | methods: { | ||
change: function (event){ | change: function (event){ | ||
- | this.text="确实" | + | if (this.bool_change){ |
- | alert("1") | + | this.text= '不是,能用原生html也太离谱了吧' |
+ | this.bool_change = false | ||
+ | }else{ | ||
+ | this.text= '确实' | ||
+ | this.bool_change = true | ||
+ | } | ||
+ | alert(this.bool_change) | ||
} | } | ||
} | } |