From dad5edad7464c1bbef4eaeb5f2c62171f400e098 Mon Sep 17 00:00:00 2001 From: "qingwei.li" Date: Mon, 14 Nov 2016 14:10:58 +0800 Subject: [PATCH] Add 'make play' --- Makefile | 3 +++ build/cooking.demo.js | 3 ++- examples/play.js | 10 ++++++++++ examples/play/index.vue | 3 --- package.json | 11 ++++++----- 5 files changed, 21 insertions(+), 9 deletions(-) create mode 100644 examples/play.js diff --git a/Makefile b/Makefile index 449e008ce..9e079c6f5 100644 --- a/Makefile +++ b/Makefile @@ -14,6 +14,9 @@ install-cn: dev: npm run dev +play: + npm run dev:play + new: node build/bin/new.js $(filter-out $@,$(MAKECMDGOALS)) diff --git a/build/cooking.demo.js b/build/cooking.demo.js index 2f085036c..40241f523 100644 --- a/build/cooking.demo.js +++ b/build/cooking.demo.js @@ -4,6 +4,7 @@ var md = require('markdown-it')(); var striptags = require('./strip-tags'); var slugify = require('transliteration').slugify; var isProd = process.env.NODE_ENV === 'production'; +var isPlay = !!process.env.PLAY_ENV; function convert(str) { str = str.replace(/(&#x)(\w{4});/gi, function($0) { @@ -16,7 +17,7 @@ cooking.set({ entry: isProd ? { docs: './examples/entry.js', 'element-ui': './src/index.js' - } : './examples/entry.js', + } : (isPlay ? './examples/play.js' : './examples/entry.js'), dist: './examples/element-ui/', template: [ { diff --git a/examples/play.js b/examples/play.js new file mode 100644 index 000000000..e6452bb53 --- /dev/null +++ b/examples/play.js @@ -0,0 +1,10 @@ +import Vue from 'vue'; +import Element from 'main/index.js'; +import App from './play/index.vue'; +import 'packages/theme-default/src/index.css'; + +Vue.use(Element); + +new Vue({ // eslint-disable-line + render: h => h(App) +}).$mount('#app'); diff --git a/examples/play/index.vue b/examples/play/index.vue index 85ccdd813..d0e6856e7 100644 --- a/examples/play/index.vue +++ b/examples/play/index.vue @@ -1,6 +1,3 @@ - -