import Vue from 'vue'
import Vuetify from 'vuetify'
Vue.use(Vuetify)
module.exports = {
build: {
vendor: ['vuetify']
},
plugins: [
'~plugins/vuetify'
]
}
<template>
<div class="container">
<v-alert success>Работай бл*ть!</v-alert>
</div>
</template>
<script>
import Vue from 'vue'
import Vuetify from 'vuetify'
Vue.use(Vuetify)
export default {
mounted () {
vuetify.init()
}
}
</script>
module.exports = {
plugins: ['~plugins/element-ui.js'],
import Vue from 'vue'
const ElementUI = require('element-ui')
const locale = require('element-ui/lib/locale/lang/ru-RU')
Vue.use(ElementUI, {local)} // если вставить global ничего не меняется, пока я не понял почему так
<template>
<div>
<el-row>
<el-col :span="24">
<el-button>Default Button</el-button>
<el-button type="primary">Primary Button</el-button>
<el-button type="text">Text Button</el-button>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-input-number v-model="num1" :min="1" :max="10"></el-input-number>
</el-col>
</el-row>
</div>
</template>
<script>
export default {
layout: 'teub',
data() {
return {
num1: 1
}
}
}
</script>
<style>
body {
font-family: "Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
padding-top: 50px;
}
.el-row {
padding: 10px;
text-align: center;
}
</style>
if (!Vue.prototype.plugin) {
Vue.use(plugin)
}
module.exports = {
plugins: [
'~plugins/validator.js',
'~plugins/lodash.js'
]
... остальные настройки
}
import Vue from 'vue'
import lodash from 'lodash'
import VueLodash from 'vue-lodash/dist/vue-lodash.min'
if (!Vue.prototype._) {
Vue.use(VueLodash, lodash)
}
import _ from 'lodash'
import Vue from 'vue'
export const validator = (Vue) => {
Vue.validator = {
applyErrors: {
inputs (inputs, errors = {}) {
_.forEach(inputs, (input) => {
input.error = ''
if (errors[input.name]) {
input.error = errors[input.name][0]
}
})
return inputs
}
}
}
// Подключаем для вызова с любой точки объекта Vue в контексте this
if (!Vue.prototype.$validator) {
Object.defineProperties(Vue.prototype, {
$validator: {
get: () => {
return Vue.validator
}
}
})
}
}
Vue.use(validator)