标签:col class 例子 method let 对象 $delete his pre
this.$delete方法是用来删除对象属性的。
语法:
this.$delete(obj,key);
例子:
<template> <div> {{testData.name}} <button @click="del">删除</button> </div> </template> <script> export default { name: "Home", data () { return { testData:{ name:"zs" } }; }, methods:{ del(){ this.$delete(this.testData,"name") } } } </script>
标签:col class 例子 method let 对象 $delete his pre
原文地址:https://www.cnblogs.com/luguankun/p/10872968.html