Nodejs配vue加UI

1、先建立好项目,项目结构参考上一个文章。

2、cmd进入项目,安装muse-ui

npm install --save muse-ui

3、编辑page下content.vue,随便在muse官网上的组件教程代码,以下是table实例

<template>
<div>
  <mu-raised-button label="unselect" @click="unselect"/>
  <mu-table multiSelectable enableSelectAll ref="table">
    <mu-thead>
      <mu-tr>
        <mu-th>ID</mu-th>
        <mu-th>Name</mu-th>
        <mu-th>Status</mu-th>
      </mu-tr>
    </mu-thead>
    <mu-tbody>
      <mu-tr>
        <mu-td>1</mu-td>
        <mu-td>John Smith</mu-td>
        <mu-td>Employed</mu-td>
      </mu-tr>
      <mu-tr>
        <mu-td>2</mu-td>
        <mu-td>Randal White</mu-td>
        <mu-td>Unemployed</mu-td>
      </mu-tr>
      <mu-tr>
        <mu-td>3</mu-td>
        <mu-td>Stephanie Sanders</mu-td>
        <mu-td>Employed</mu-td>
      </mu-tr>
      <mu-tr>
        <mu-td>4</mu-td>
        <mu-td>Steve Brown</mu-td>
        <mu-td>Employed</mu-td>
      </mu-tr>
    </mu-tbody>
  </mu-table>
</div>
</template>
<script>
import Vue from 'vue'
import MuseUI from 'muse-ui'
import 'muse-ui/dist/muse-ui.css'
Vue.use(MuseUI)

export default {
  methods: {
    unselect () {
      this.$refs.table.unSelectAll()
    }
  }
}
</script>

4、运行

npm run dev
阅读更多
个人分类: nodejs
想对作者说点什么? 我来说一句

没有更多推荐了,返回首页

不良信息举报

Nodejs配vue加UI

最多只允许输入30个字

加入CSDN,享受更精准的内容推荐,与500万程序员共同成长!
关闭
关闭