//删除数组索引方法01
del (index) { this.arr.splice(index ,1); }
//删除数组索引方法01
del (index) { this.$delete(this.arr, index); }
//获取输入框内容
<input type="text" v-model="message" @focus="$event.target.select()">

  

//子向父传递参数  this.$emit('hide');<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>vue-demo</title>
    <link rel="stylesheet" href="src/dist/styles/iview.css">
    <script src="src/dist/vue.min.js"></script>
    <script src="src/dist/iview.min.js"></script>
</head>
<body>
    <div id="page">
        <my-dialog :is-show="isShow" @hide="toggle"></my-dialog>
        <i-button @click="toggle">显示切换</i-button>
    </div>
    <script src="src/components/text01.js"></script>
</body>
</html>
//js代码
//vue2.0 定义局部组件时  组件首字母要大写 vue1.0 大小写都支持
var Dialog = {
    template: '<div v-if="isShow">aaaaaaaaaaaaaa<i-button @click="toHide">子组件关闭</i-button></div>',
    props:['isShow'],
    methods:{
        toHide:function(){
           this.$emit('hide');
        }
    }
}

// 注册
Vue.component('my-component', {
  template: '<div>A custom component!</div>'
})

new Vue({
    el:'#page',
    data:{
        isShow:false
    },
    methods:{
        toggle:function(){
            this.isShow = !this.isShow;
        }
    },
    components: {
        'my-dialog': Dialog
    }
})

最新文章

  1. Util应用程序框架公共操作类(六):验证扩展
  2. typedef 函数指针 数组 std::function
  3. 利用npoi导出Excel
  4. BUCK-BOOST反激变压器设计
  5. pycharm 常用设置
  6. js实现简单易用的上下无缝滚动效果
  7. NPOI 2.0导出word(docx格式)
  8. Objective-C 【多个对象内存管理(野指针&amp;内存泄漏)】
  9. mac 卸载 XCode
  10. 【6】python核心编程 第九章-文件和输入输出
  11. CSS3实现时间轴效果
  12. reinterpret_cast,static_cast, dynamic_cast,const_cast的运用分析
  13. jenkins使用3----相关工具安装
  14. xpath分析 html文件抽正文的过程
  15. redhat5 安装mysql 5.6
  16. 【Python】torrentParser1.02
  17. 数据科学实战手册(R+Python)书中引用资料网址
  18. 【莫队】【P3834】 【模板】可持久化线段树 1(主席树)
  19. TangoAreaDescriptionMetaData区域描述元数据
  20. purfer序列题表

热门文章

  1. Flutter 1.5 发布,正式成为全平台 UI 框架!
  2. linux 数据库
  3. ora-01157怎么解决
  4. 大家都能看懂的 canvas基础教程
  5. MYSQL INT(N)以及zerofill的使用区别
  6. CCS+C6678LE开发记录12:UIA组件的安装
  7. 还是bib问题
  8. 记一次mysql性能优化过程
  9. VP红外遥控器实现
  10. python中index、slice与slice assignment用法