mirror of
https://github.com/nuxt/nuxt.git
synced 2025-01-30 15:22:39 +00:00
feat: add vux example
This commit is contained in:
parent
f9d2bce5af
commit
86473aa17f
9
examples/with-vux/layouts/default.vue
Normal file
9
examples/with-vux/layouts/default.vue
Normal file
@ -0,0 +1,9 @@
|
||||
<template>
|
||||
<nuxt></nuxt>
|
||||
</template>
|
||||
|
||||
<style>
|
||||
body {
|
||||
background-color: #fbf9fe;
|
||||
}
|
||||
</style>
|
39
examples/with-vux/nuxt.config.js
Normal file
39
examples/with-vux/nuxt.config.js
Normal 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
|
||||
}
|
||||
}
|
||||
}
|
19
examples/with-vux/package.json
Normal file
19
examples/with-vux/package.json
Normal 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"
|
||||
}
|
||||
}
|
23
examples/with-vux/pages/index.vue
Normal file
23
examples/with-vux/pages/index.vue
Normal 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>
|
5
examples/with-vux/plugins/vux-components.js
Normal file
5
examples/with-vux/plugins/vux-components.js
Normal file
@ -0,0 +1,5 @@
|
||||
import Vue from 'vue'
|
||||
import { Group, Cell } from 'vux'
|
||||
|
||||
Vue.component('group', Group)
|
||||
Vue.component('cell', Cell)
|
12
examples/with-vux/plugins/vux-plugins.js
Normal file
12
examples/with-vux/plugins/vux-plugins.js
Normal 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)
|
1
examples/with-vux/styles/theme.less
Normal file
1
examples/with-vux/styles/theme.less
Normal file
@ -0,0 +1 @@
|
||||
@dialog-button-text-primary-color: #FF9900;
|
Loading…
Reference in New Issue
Block a user