npm i muse-ui -S
import Vue from "vue";
import App from "./App.vue";
import MuseUI from 'muse-ui';
import 'muse-ui/dist/muse-ui.css';
Vue.config.productionTip = false;
Vue.use(MuseUI);
new Vue({
render: h => h(App)
}).$mount("#app");
https://cdn.bootcss.com/material-design-icons/3.0.1/iconfont/ +【字体名称】
例:https://cdn.bootcss.com/material-design-icons/3.0.1/iconfont/MaterialIcons-Regular.woff2
material-icons.css 3.0.1 代码如下:
@font-face {
font-family: 'Material Icons';
font-style: normal;
font-weight: 400;
src: url(MaterialIcons-Regular.eot); /* For IE6-8 */
src: local('Material Icons'),
local('MaterialIcons-Regular'),
url(MaterialIcons-Regular.woff2) format('woff2'),
url(MaterialIcons-Regular.woff) format('woff'),
url(MaterialIcons-Regular.ttf) format('truetype');
}
.material-icons {
font-family: 'Material Icons';
font-weight: normal;
font-style: normal;
font-size: 24px; /* Preferred icon size */
display: inline-block;
line-height: 1;
text-transform: none;
letter-spacing: normal;
word-wrap: normal;
white-space: nowrap;
direction: ltr;
/* Support for all WebKit browsers. */
-webkit-font-smoothing: antialiased;
/* Support for Safari and Chrome. */
text-rendering: optimizeLegibility;
/* Support for Firefox. */
-moz-osx-font-smoothing: grayscale;
/* Support for IE. */
font-feature-settings: 'liga';
}
material-icons.css 3.0.1 修改后的代码如下:
@font-face {
font-family: 'Material Icons';
font-style: normal;
font-weight: 400;
/* 路径需要写自己真实存放的地方 */
src:url(MaterialIcons-Regular.woff2) format('woff2'),
}
.material-icons {
font-family: 'Material Icons';
font-weight: normal;
font-style: normal;
font-size: 24px; /* Preferred icon size */
display: inline-block;
line-height: 1;
text-transform: none;
letter-spacing: normal;
word-wrap: normal;
white-space: nowrap;
direction: ltr;
/* Support for all WebKit browsers. */
-webkit-font-smoothing: antialiased;
/* Support for Safari and Chrome. */
text-rendering: optimizeLegibility;
/* Support for Firefox. */
-moz-osx-font-smoothing: grayscale;
/* Support for IE. */
font-feature-settings: 'liga';
}
main.ts 修改后代码:
import Vue from "vue";
import App from "./App.vue";
import router from "./router";
import store from "./store";
import MuseUI from 'muse-ui';
import 'muse-ui/dist/muse-ui.css';
//需要注意这里的文件位置,按自己喜好修改,切勿复制了事
import './assets/css/material-icons.css'
Vue.use(MuseUI);
Vue.config.productionTip = false;
new Vue({
router,
store,
render: h => h(App)
}).$mount("#app");
<template>
<div id="app">
<!-- 顶部导航条 -->
<mu-appbar style="width: 100%;" color="primary">
<mu-button icon slot="left">
<mu-icon value="menu"></mu-icon>
</mu-button>潇风易水
<mu-button flat slot="right">LOGIN</mu-button>
</mu-appbar>
<!-- 内容 -->
<mu-container>
<mu-card style="width: 100%; max-width: 375px; margin: 0 auto;">
<mu-card-header title="Myron Avatar" sub-title="sub title">
<mu-avatar slot="avatar">
<img src="../src/assets/images/1.png" />
</mu-avatar>
</mu-card-header>
<mu-card-media title="Image Title" sub-title="Image Sub Title">
<img src="../src/assets/images/1.png" />
</mu-card-media>
<mu-card-title title="Content Title" sub-title="Content Title"></mu-card-title>
<mu-card-text>
散落在指尖的阳光,我试着轻轻抓住光影的踪迹,它却在眉宇间投下一片淡淡的阴影。
调皮的阳光掀动了四月的心帘,温暖如约的歌声渐起。
似乎在诉说着,我也可以在漆黑的角落里,找到阴影背后的阳光,
找到阳光与阴影奏出和谐的旋律。我要用一颗敏感赤诚的心迎接每一缕滑过指尖的阳光!
</mu-card-text>
<mu-card-actions>
<mu-button flat>Action 1</mu-button>
<mu-button flat>Action 2</mu-button>
</mu-card-actions>
</mu-card>
</mu-container>
<!-- 底部导航 -->
<mu-container>
<mu-bottom-nav>
<mu-bottom-nav-item title="Recents" icon="restore"></mu-bottom-nav-item>
<mu-bottom-nav-item title="Favorites" icon="favorite"></mu-bottom-nav-item>
<mu-bottom-nav-item title="Nearby" icon="location_on"></mu-bottom-nav-item>
</mu-bottom-nav>
</mu-container>
</div>
</template>
<style lang="less">
</style>