From 9b0bec0cd75c2925bbd4ccddf95bbac4c013ec01 Mon Sep 17 00:00:00 2001 From: zazzaz Date: Tue, 25 Aug 2020 09:58:26 +0800 Subject: [PATCH] feat: add website play --- package.json | 8 +- packages/locale/index.ts | 2 +- website/entry.js | 3 +- website/index.tpl | 4 +- website/play.js | 14 +- website/play/index.vue | 6 +- website/route.config.js | 6 - website/webpack.config.js | 3 +- yarn.lock | 4108 ++++++++++++++++++------------------- 9 files changed, 2069 insertions(+), 2085 deletions(-) diff --git a/package.json b/package.json index ad682a1d41..94c7af0e08 100644 --- a/package.json +++ b/package.json @@ -11,10 +11,11 @@ "build": "yarn bootstrap && yarn build-storybook", "lint": "eslint ./packages --ext .vue,.js,.ts", "website-build": "webpack --config ./website/webpack.config.js", - "website-dev": "webpack-dev-server --config ./website/webpack.config.js" + "website-dev": "webpack-dev-server --config ./website/webpack.config.js", + "website-dev:play": "PLAY_ENV=true yarn website-dev" }, "peerDependencies": { - "vue": "^3.0.0-rc.7" + "vue": "^3.0.0-rc.6" }, "devDependencies": { "@babel/core": "^7.10.5", @@ -27,7 +28,7 @@ "@types/lodash": "^4.14.159", "@typescript-eslint/eslint-plugin": "^3.7.0", "@typescript-eslint/parser": "^3.7.0", - "@vue/compiler-sfc": "^3.0.0-rc.7", + "@vue/compiler-sfc": "^3.0.0-rc.6", "@vue/component-compiler-utils": "^3.2.0", "algoliasearch": "^4.4.0", "babel-loader": "^8.1.0", @@ -88,6 +89,7 @@ "license": "MIT", "dependencies": { "@popperjs/core": "^2.4.4", + "dayjs": "1.x", "lodash": "^4.17.20", "mitt": "^2.1.0" } diff --git a/packages/locale/index.ts b/packages/locale/index.ts index 73efd45124..f8d822a830 100644 --- a/packages/locale/index.ts +++ b/packages/locale/index.ts @@ -8,7 +8,7 @@ export const t = (path:string): string => { let current = lang for (let i = 0, j = array.length; i < j; i++) { const property = array[i] - value = current[property] || property + value = current[property] if (i === j - 1) return value if (!value) return '' current = value diff --git a/website/entry.js b/website/entry.js index 3873cef2e1..8aec355f1b 100644 --- a/website/entry.js +++ b/website/entry.js @@ -16,7 +16,8 @@ import icon from './icon.json' import App from './app.vue' import install from 'element-plus' -// import '../src/style/element-ui@2.13.2.css' +if(process.env.NODE_ENV === 'development') require('../src/style/element-ui@2.13.2.css') + const app = createApp(App) diff --git a/website/index.tpl b/website/index.tpl index 765cd17335..133b3de50c 100644 --- a/website/index.tpl +++ b/website/index.tpl @@ -10,7 +10,9 @@
- + <% if (process.env.NODE_ENV === 'production') { %> + + <% } %> <% if (process.env.NODE_ENV === 'production') { %>