Element基本示例

2023-05-03 10:24:19 浏览数 (1)

这是一个基于vue3的组件库,emmm果然入门是最难的,记录一个基本示例吧

代码语言:javascript复制
<html>
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width,initial-scale=1.0" />
    <script src="https://unpkg.com/vue@next"></script>
    <link rel="stylesheet" href="https://unpkg.com/element-plus/dist/index.css">
    <script src="https://unpkg.com/element-plus"></script>
    <title>Element Plus demo</title>
  </head>
  <body>
    <div id="app">
      <el-button type="primary" plain @click="on">{{ message }}</el-button>
    </div>
    <script>
      const App = {
        data() {
          return {
            message: "点我一下就会 1哦",
            num:0,
          };
        },
        methods:{
          on(){
            this.$notify({
            title: 'Title',
            message:  'This is a reminder',
          })
          this.num  
          this.message="我现在是" this.num "啦";
          }
        }
      };
      const app = Vue.createApp(App);
      app.use(ElementPlus);
      app.mount("#app");
    </script>
  </body>
</html>

0 人点赞