Are you sure you want to delete this task? Once this task is deleted, it cannot be recovered.
Koma db753636d8 | 6 years ago | |
---|---|---|
.. | ||
README.md | 6 years ago | |
index.html | 7 years ago |
设置计算属性,同步更新元数据的值。(又是令人费解的描述)
<div id="myApp">
<p>今年3月3日发卖的任天堂新一代主机Switch的价格是:{{price}}円,含税价格为:{{priceInTax}}円,折合人民币为:{{priceChinaRMB}}元。</p>
<button @click="btnClick(10800)">把含税改价为10800円</button>
</div>
<script>
var myApp = new Vue({
el: '#myApp',
data: {
price: 29980
},
computed: {
priceInTax: {
get:function(){
return this.price * 1.08;
},
set: function(value){
this.price = value / 1.08;
}
},
priceChinaRMB: function(){
return Math.round(this.priceInTax / 16.75);
},
},
methods: {
btnClick: function(newPrice){
this.priceInTax = newPrice;
},
},
});
</script>
Vue.js学习工程
HTML CSS Markdown
Dear OpenI User
Thank you for your continuous support to the Openl Qizhi Community AI Collaboration Platform. In order to protect your usage rights and ensure network security, we updated the Openl Qizhi Community AI Collaboration Platform Usage Agreement in January 2024. The updated agreement specifies that users are prohibited from using intranet penetration tools. After you click "Agree and continue", you can continue to use our services. Thank you for your cooperation and understanding.
For more agreement content, please refer to the《Openl Qizhi Community AI Collaboration Platform Usage Agreement》