feat: add vux example

This commit is contained in:
airyland 2018-03-09 18:01:06 +08:00
parent f9d2bce5af
commit 86473aa17f
7 changed files with 108 additions and 0 deletions

View File

@ -0,0 +1,9 @@
<template>
<nuxt></nuxt>
</template>
<style>
body {
background-color: #fbf9fe;
}
</style>

View File

@ -0,0 +1,39 @@
const vuxLoader = require('vux-loader')
const path = require('path')
module.exports = {
head: {
meta: [
{ charset: 'utf-8' },
{ name: 'viewport', content: 'width=device-width, initial-scale=1, user-scalable=0' }
]
},
css: [
'vux/src/styles/reset.less',
'vux/src/styles/1px.less'
],
plugins: [
{
src: '~/plugins/vux-plugins',
ssr: false
},
{
src: '~/plugins/vux-components',
ssr: true
}
],
build: {
extend(config, { isDev, isClient }) {
const configs = vuxLoader.merge(config, {
options: {
ssr: true
},
plugins: ['vux-ui', {
name: 'less-theme',
path: path.join(__dirname, './styles/theme.less')
}]
})
return configs
}
}
}

View File

@ -0,0 +1,19 @@
{
"name": "with-vux",
"version": "1.0.0",
"license": "MIT",
"dependencies": {
"nuxt": "latest",
"vux": "^2.8.0"
},
"scripts": {
"dev": "nuxt",
"build": "nuxt build",
"start": "nuxt start"
},
"devDependencies": {
"less": "^2.7.3",
"less-loader": "^4.0.6",
"vux-loader": "^1.2.1"
}
}

View File

@ -0,0 +1,23 @@
<template>
<div>
<group title="vux demo">
<cell title="cell" value="click me" is-link @click.native="alert"></cell>
</group>
</div>
</template>
<script>
export default {
head() {
return {
title: 'vux demo'
}
},
methods: {
alert() {
this.$vux.alert.show('This is a Alert example.')
}
}
}
</script>

View File

@ -0,0 +1,5 @@
import Vue from 'vue'
import { Group, Cell } from 'vux'
Vue.component('group', Group)
Vue.component('cell', Cell)

View File

@ -0,0 +1,12 @@
import Vue from 'vue'
import { BusPlugin, TransferDom, WechatPlugin, DatetimePlugin, LoadingPlugin, ToastPlugin, AlertPlugin, ConfirmPlugin } from 'vux'
Vue.use(DatetimePlugin)
Vue.use(LoadingPlugin)
Vue.use(ToastPlugin)
Vue.use(AlertPlugin)
Vue.use(ConfirmPlugin)
Vue.use(WechatPlugin)
Vue.use(BusPlugin)
Vue.directive('transfer-dom', TransferDom)

View File

@ -0,0 +1 @@
@dialog-button-text-primary-color: #FF9900;