美文网首页
vue基础概念

vue基础概念

作者: 大胡子111 | 来源:发表于2018-07-23 14:56 被阅读33次

1、v-model(绑定数据)
2、v-for(循环)
3、v-on(绑定事件)
4、$index(索引)
5、v-if(不满足条件的话则不会出现在dom中)
6、v-show(不满足条件,则样式会设置成隐藏 display:none;)

 HTML:
       <h1 v-show="ok">Hello!</h1>
    JS:
     data() {
            return {
                ok:true
            }
        },

7、data(数据)

   data() {
            return {
                status:{
                    "true":"已开通",
                    "false":"未开通",
                    "fail":"审核失败"
                },
                currentPage:1,
                currentLimit:10,
                tableData3: []
            }
        },

8、生命周期

       beforeCreate() {
            console.log('beforeCreate:页面创建之前')
        },
        created() {
            console.log('created:页面创建完成')
        },
        beforeMount() {
            console.log('beforeMount:页面挂载之前')
        },
        mounted() {
            console.log('mounted:页面挂载完成')
            this.getList();
        },
        beforeUpdate() {
            console.log('beforeUpdate:数据更新之前')
        },
        updated() {
            console.log('updated:数据更新完成')
        },
        beforeDestroy() {
            console.log('beforeDestroy:页面卸载之前')
        },
        destroyed() {
            console.log('destroyed:页面卸载完成')
        },

9、methods(方法)

           methods: {
            //编辑操作
            handleEdit(index,item){
                console.log('编辑方法')
            },
            //删除操作
            handleDelete(index,item){
              console.log('删除方法')
            }
        }

相关文章

  • vue基础概念

    1、v-model(绑定数据)2、v-for(循环)3、v-on(绑定事件)4、$index(索引)5、v-if(...

  • 渐进式框架 Vue.js 基础入门及简单编程演示

    渐进式框架 Vue.js 基础入门及简单编程演示 ---------------------- 概念基础 ----...

  • vue-element-admin技术栈

    基础概念 vue-cli vue-cli 俗称vue脚手架,是一个vue开发的环境,将你写的vue文件、sass文...

  • 3 个概念,入门 Vue 组件开发

    “组件”是 Vue 中比较基础的概念,但我发现,许多人对 Vue 组件的概念和由来并不是清楚。因此,我希望通过这个...

  • vue基础概念介绍

    组件化 vue的组件化是指把传统的html, css, js资源集成到一个.vue文件中,组成一个单独的组件,被其...

  • Vue-基础概念

    vue的概念 vue的使用 生命周期 语法

  • Vue 成长之旅 | Vue基础用法一

    一、Vue 基础使用 二 、 Vue的指令与过滤器 1、指令的概念 指令: 是vue为开发者提供的模板语法 , 用...

  • vue入门--week1

    vue学习笔记,比较基础。 mvc 和mvvc的区别 mvc是后端概念:model、view、controller...

  • vue3基础概念

    官网 https://v3.cn.vuejs.org/guide/introduction.html[https:...

  • vue 代码分离和懒加载

    基础概念 异步组件 vue.js允许将组件定义为一个工厂函数,异步的解析组件的定义。vue.js只在组件需要渲染时...

网友评论

      本文标题:vue基础概念

      本文链接:https://www.haomeiwen.com/subject/fqcjmftx.html