mirror of
https://github.com/Hopiu/vue-material.git
synced 2026-05-09 16:04:45 +00:00
77 lines
2.5 KiB
Vue
77 lines
2.5 KiB
Vue
<template>
|
|
<single-page class="single-page-home" label="Getting Started">
|
|
<single-page-banner label="Getting Started"></single-page-banner>
|
|
|
|
<single-page-section label="Installation">
|
|
<p>
|
|
- Install Vue Material through npm or yarn: <br>
|
|
<code>npm install vue-material</code><br>
|
|
<code>yarn add vue-material</code>
|
|
</p>
|
|
<p>- Import or require Vue and Vue Material in your code:</p>
|
|
<code-block lang="javascript">
|
|
import Vue from 'vue';
|
|
import VueMaterial from 'vue-material';
|
|
|
|
// OR
|
|
|
|
var Vue = require('vue');
|
|
var VueMaterial = require('vue-material');
|
|
</code-block>
|
|
<small>* Others package managers like JSPM and Bower are not supported yet.</small>
|
|
|
|
<p>Or <a href="https://github.com/marcosmoura/vue-material/archive/master.zip" target="_blank" rel="noopener">download</a> from Github and reference the script and the stylesheet in your HTML:</p>
|
|
<code-block lang="xml">
|
|
<link rel="stylesheet" href="path/to/vue-material.css">
|
|
<script src="path/to/vue-material.js"></script>
|
|
</code-block>
|
|
</single-page-section>
|
|
|
|
<single-page-section label="Usage">
|
|
<p>Enable Vue Material in your application using <code>Vue.use()</code>. You can always enable individual components:</p>
|
|
<code-block lang="javascript">
|
|
Vue.use(VueMaterial);
|
|
|
|
// OR
|
|
|
|
Vue.use(VueMaterial.MdCore); //Required to boot vue material
|
|
Vue.use(VueMaterial.MdButton);
|
|
Vue.use(VueMaterial.MdIcon);
|
|
Vue.use(VueMaterial.MdSidenav);
|
|
Vue.use(VueMaterial.MdToolbar);
|
|
</code-block>
|
|
</single-page-section>
|
|
|
|
<single-page-section label="Apply theme">
|
|
<p>To get Vue Material working properly, you'll need to configure and apply a default theme.</p>
|
|
<code-block lang="javascript">
|
|
Vue.material.theme.register('default', {
|
|
primary: 'cyan',
|
|
accent: 'pink'
|
|
});
|
|
</code-block>
|
|
|
|
<p>Or you can register multiple themes at once.</p>
|
|
|
|
<code-block lang="javascript">
|
|
Vue.material.theme.registerAll({
|
|
default: {
|
|
primary: 'cyan',
|
|
accent: 'pink'
|
|
},
|
|
phone: {
|
|
primary: 'indigo',
|
|
accent: 'pink'
|
|
}
|
|
});
|
|
</code-block>
|
|
|
|
<p>Apply your theme using <code>v-md-theme</code> directive:</p>
|
|
|
|
<code-block lang="xml">
|
|
<div v-md-theme="'default'"></div>
|
|
<div v-md-theme="'phone'"></div>
|
|
</code-block>
|
|
</single-page-section>
|
|
</single-page>
|
|
</template>
|