简体   繁体   English

Vue材料-我看不到变化

[英]Vue material - I don't see changes

I am using http://vuematerial.io/#/getting-started in my vue project (webpack, hot reloads, babel and so on). 我在vue项目中使用了http://vuematerial.io/#/getting-started(Webpack ,热重装,babel等)。

I've imported this library (via npm) and included it in main.js file hovewer i don't see any changes in my project. 我已经通过npm导入了该库,并将其包含在main.js文件中,但是我在项目中看不到任何更改。 The browser doesnt render it. 浏览器不会渲染它。

What am i doing wrong? 我究竟做错了什么?

main.js: main.js:

import Vue from 'vue'
import VueMaterial from 'vue-material'
import 'vue-material/dist/vue-material'
import App from './App.vue'

Vue.use(VueMaterial)

Vue.material.registerTheme('default', {
  primary: 'blue',
  accent: 'red',
  warn: 'red',
  background: 'grey'
})

/* eslint-disable no-new */
new Vue({
  el: 'body'
  components: { App },
  render: h => h(App)
})

App.vue: App.vue:

<template>
  <div id="app">
    <hello></hello>
    <md-button>Default</md-button> // this doesnt work!
  </div>
</template>

<script>

export default {
  components: {
    'hello': Hello,
    'documents': Documents,
    'Home': Home
  },
  data: function () {
    return {

    }
  }
}
</script>

Have you tried terminating the job in node and serving again? 您是否尝试过终止节点中的工作并再次提供服务? I havent used vue-material myself but I find this issue cropped up a few times while I was dabbling in vue. 我本人并没有使用vue资料,但是当我涉猎vue时,我发现这个问题出现了几次。

Is your vue-material.css being imported correctly? 您的vue-material.css是否正确导入?

Try changing import 'vue-material/dist/vue-material' to import 'vue-material/dist/vue-material.css' 尝试将import 'vue-material/dist/vue-material'更改为import 'vue-material/dist/vue-material.css'

I can't tell from your question if this is your problem or whether you are having problems with the hot reloading. 从您的问题中我无法确定这是您的问题,还是热重装是否有问题。 Might try to describe what you see in the browser. 可能尝试描述您在浏览器中看到的内容。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM