Vue 常用插件,初始化文件

首页 / 正文

常用插件整理

npm install axios --save 

npm install js-cookie --save

npm install xlsx

//组件包看官方文档 https://element-plus.gitee.io/zh-CN/
yarn add element-plus
yarn add @element-plus/icons-vue

Vue 初始化文件

<template>
  <div class="init">
    <h1>This is an init page</h1>
  </div>
</template>
  
  <script>
  import {reactive,toRefs,onBeforeMount,onMounted,onBeforeUpdate,onUpdated} from 'vue'
  export default{
    name:'init',//模板名称
    //setup相当于vue2中的 beforecreate和create 
    setup() {
      const data = reactive({
  
      })
      
      // 数据渲染前
      // onBeforeMount(()=>{
      // })
      // 数据渲染后
      // onMounted(()=>{

      // })
      //dom页面更新还没同步之前
      // onBeforeUpdate(()=>{
        
      })
      //dom页面更新同步之后
      // onUpdated(()=>{

      // })

      return {
      ...toRefs(data)
    }
    }
  
  }
  </script>
//样式只在作用在当前页面
     <style scoped>
       
     </style>
打赏
评论区
头像