码迷,mamicode.com
首页 > 其他好文 > 详细

实例方法this.$delete的使用

时间:2019-05-16 00:02:03      阅读:210      评论:0      收藏:0      [点我收藏+]

标签: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>

 

实例方法this.$delete的使用

标签:col   class   例子   method   let   对象   $delete   his   pre   

原文地址:https://www.cnblogs.com/luguankun/p/10872968.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!