Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
Element
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
CI / CD Analytics
Repository Analytics
Value Stream Analytics
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
林焕东
Element
Commits
cee31543
Commit
cee31543
authored
Oct 26, 2017
by
Leopoldthecoder
Committed by
杨奕
Oct 26, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update release scripts
parent
07acf66a
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
60 additions
and
257 deletions
+60
-257
build/deploy-ci.sh
build/deploy-ci.sh
+2
-3
build/deploy-faas.sh
build/deploy-faas.sh
+2
-3
build/git-release.sh
build/git-release.sh
+1
-1
build/release.sh
build/release.sh
+19
-3
examples/components/demo-block.vue
examples/components/demo-block.vue
+3
-2
examples/components/header.vue
examples/components/header.vue
+5
-1
examples/docs/en-US/installation.md
examples/docs/en-US/installation.md
+7
-7
examples/docs/en-US/quickstart.md
examples/docs/en-US/quickstart.md
+7
-115
examples/docs/zh-CN/installation.md
examples/docs/zh-CN/installation.md
+7
-7
examples/docs/zh-CN/quickstart.md
examples/docs/zh-CN/quickstart.md
+7
-115
No files found.
build/deploy-ci.sh
View file @
cee31543
...
...
@@ -42,11 +42,10 @@ if [ "$TRAVIS_TAG" ]; then
SUB_FOLDER
=
'2.0'
mkdir
$SUB_FOLDER
#
rm -rf *.js *.css *.map static
rm
-rf
*
.js
*
.css
*
.map static
rm
-rf
$SUB_FOLDER
/
**
#
cp -rf ../../examples/element-ui/** .
cp
-rf
../../examples/element-ui/
**
.
cp
-rf
../../examples/element-ui/
**
$SUB_FOLDER
/
cp
-rf
../../examples/element-ui/versions.json
.
git add
-A
.
git commit
-m
"
$TRAVIS_COMMIT_MSG
"
git push origin gh-pages
...
...
build/deploy-faas.sh
View file @
cee31543
...
...
@@ -7,11 +7,10 @@ git clone -b gh-pages https://github.com/ElemeFE/element.git && cd element
# build sub folder
SUB_FOLDER
=
'2.0'
mkdir
$SUB_FOLDER
#
rm -rf *.js *.css *.map static
rm
-rf
*
.js
*
.css
*
.map static
rm
-rf
$SUB_FOLDER
/
**
#
cp -rf ../../examples/element-ui/** .
cp
-rf
../../examples/element-ui/
**
.
cp
-rf
../../examples/element-ui/
**
$SUB_FOLDER
/
cp
-rf
../../examples/element-ui/versions.json
.
cd
../..
# deploy domestic site
...
...
build/git-release.sh
View file @
cee31543
#!/usr/bin/env sh
git checkout
carbon
git checkout
dev
if
test
-n
"
$(
git status
--porcelain
)
"
;
then
echo
'Unclean working tree. Commit or stash changes first.'
>
&2
;
...
...
build/release.sh
View file @
cee31543
git checkout master
git merge dev
#!/usr/bin/env sh
set
-e
echo
"Enter release version: "
...
...
@@ -16,7 +19,12 @@ then
echo
"Releasing theme-chalk
$VERSION
..."
cd
packages/theme-chalk
npm version
$VERSION
--message
"[release]
$VERSION
"
npm publish
if
[[
$VERSION
=
~
"beta"
]]
then
npm publish
--tag
beta
else
npm publish
fi
cd
../..
# commit
...
...
@@ -25,8 +33,16 @@ then
npm version
$VERSION
--message
"[release]
$VERSION
"
# publish
git push eleme
carbon
git push eleme
master
git push eleme refs/tags/v
$VERSION
git checkout dev
git rebase master
git push eleme dev
npm publish
--tag
next
if
[[
$VERSION
=
~
"beta"
]]
then
npm publish
--tag
beta
else
npm publish
fi
fi
examples/components/demo-block.vue
View file @
cee31543
...
...
@@ -178,6 +178,7 @@
<
script
type=
"text/babel"
>
import
compoLang
from
'
../i18n/component.json
'
;
import
{
version
}
from
'
main/index.js
'
;
export
default
{
data
()
{
...
...
@@ -200,10 +201,10 @@
goJsfiddle
()
{
const
{
script
,
html
,
style
}
=
this
.
jsfiddle
;
const
resourcesTpl
=
'
<scr
'
+
'
ipt src="//unpkg.com/vue/dist/vue.js"></scr
'
+
'
ipt>
'
+
'
\n
<scr
'
+
'
ipt src="//unpkg.com/element-ui@next/lib/index.js"></scr
'
+
'
ipt>
'
;
'
\n
<scr
'
+
`ipt src="//unpkg.com/element-ui@
${
version
}
/lib/index.js"></scr`
+
'
ipt>
'
;
let
jsTpl
=
(
script
||
''
).
replace
(
/export default/
,
'
var Main =
'
).
trim
();
let
htmlTpl
=
`
${
resourcesTpl
}
\n<div id="app">\n
${
html
.
trim
()}
\n</div>`
;
let
cssTpl
=
`@import url("//unpkg.com/element-ui@
next
/lib/theme-chalk/index.css");\n
${(
style
||
''
).
trim
()}
\n`
;
let
cssTpl
=
`@import url("//unpkg.com/element-ui@
${
version
}
/lib/theme-chalk/index.css");\n
${(
style
||
''
).
trim
()}
\n`
;
jsTpl
=
jsTpl
?
jsTpl
+
'
\n
var Ctor = Vue.extend(Main)
\n
new Ctor().$mount(
\'
#app
\'
)
'
:
'
new Vue().$mount(
\'
#app
\'
)
'
;
...
...
examples/components/header.vue
View file @
cee31543
...
...
@@ -390,7 +390,11 @@
const
xhr
=
new
XMLHttpRequest
();
xhr
.
onreadystatechange
=
_
=>
{
if
(
xhr
.
readyState
===
4
&&
xhr
.
status
===
200
)
{
this
.
versions
=
JSON
.
parse
(
xhr
.
responseText
);
const
versions
=
JSON
.
parse
(
xhr
.
responseText
);
this
.
versions
=
Object
.
keys
(
versions
).
slice
(
-
2
).
reduce
((
prev
,
next
)
=>
{
prev
[
next
]
=
versions
[
next
];
return
prev
;
},
{});
}
};
xhr
.
open
(
'
GET
'
,
'
/versions.json
'
);
...
...
examples/docs/en-US/installation.md
View file @
cee31543
...
...
@@ -4,21 +4,21 @@
Installing with npm is recommended and it works seamlessly with
[
webpack
](
https://webpack.js.org/
)
.
```
shell
npm i element-ui
@next
-S
npm i element-ui
-S
```
### CDN
Get the latest version from
[
unpkg.com/element-ui
](
https://unpkg.com/element-ui
@next
/
)
, and import JavaScript and CSS file in your page.
Get the latest version from
[
unpkg.com/element-ui
](
https://unpkg.com/element-ui/
)
, and import JavaScript and CSS file in your page.
```
html
<!-- import CSS -->
<link
rel=
"stylesheet"
href=
"https://unpkg.com/element-ui
@next
/lib/theme-chalk/index.css"
>
<link
rel=
"stylesheet"
href=
"https://unpkg.com/element-ui/lib/theme-chalk/index.css"
>
<!-- import JavaScript -->
<script
src=
"https://unpkg.com/element-ui
@next
/lib/index.js"
></script>
<script
src=
"https://unpkg.com/element-ui/lib/index.js"
></script>
```
### Hello world
If you are using CDN, a hello-world page is easy with Element.
[
Online Demo
](
https://jsfiddle.net/
leopoldthecuber/hzfpyvg6/1
/
)
If you are using CDN, a hello-world page is easy with Element.
[
Online Demo
](
https://jsfiddle.net/
hzfpyvg6/14
/
)
```
html
<!DOCTYPE html>
...
...
@@ -26,7 +26,7 @@ If you are using CDN, a hello-world page is easy with Element. [Online Demo](htt
<head>
<meta
charset=
"UTF-8"
>
<!-- import CSS -->
<link
rel=
"stylesheet"
href=
"https://unpkg.com/element-ui
@next
/lib/theme-chalk/index.css"
>
<link
rel=
"stylesheet"
href=
"https://unpkg.com/element-ui/lib/theme-chalk/index.css"
>
</head>
<body>
<div
id=
"app"
>
...
...
@@ -39,7 +39,7 @@ If you are using CDN, a hello-world page is easy with Element. [Online Demo](htt
<!-- import Vue before Element -->
<script
src=
"https://unpkg.com/vue/dist/vue.js"
></script>
<!-- import JavaScript -->
<script
src=
"https://unpkg.com/element-ui
@next
/lib/index.js"
></script>
<script
src=
"https://unpkg.com/element-ui/lib/index.js"
></script>
<script>
new
Vue
({
el
:
'
#app
'
,
...
...
examples/docs/en-US/quickstart.md
View file @
cee31543
...
...
@@ -6,123 +6,15 @@ This part walks you through the process of using Element in a webpack project.
Under construction.
### Config files
Create a new project, and its structure should be
```
text
|- src/ --------------------- source code
|- App.vue
|- main.js -------------- entry
|- .babelrc ----------------- babel config
|- index.html --------------- HTML template
|- package.json ------------- npm config
|- README.md ---------------- readme
|- webpack.config.js -------- webpack config
```
### Use vue-cli
Typical configurations for these config files are
:
It is recommended to start a project using
[
vue-cli
](
https://github.com/vuejs/vue-cli
)
:
**.babelrc**
```
json
{
"presets"
:
[
"vue-app"
]
}
```
<br>
**package.json**
```
json
{
"name"
:
"element-starter"
,
"scripts"
:
{
"dev"
:
"cross-env NODE_ENV=development webpack-dev-server --inline --hot --port 8086"
,
"build"
:
"cross-env NODE_ENV=production webpack --progress --hide-modules"
},
"dependencies"
:
{
"element-ui"
:
"next"
,
"vue"
:
"^2.4.2"
},
"devDependencies"
:
{
"babel-core"
:
"^6.0.0"
,
"babel-loader"
:
"^6.0.0"
,
"babel-preset-vue-app"
:
"^1.2.0"
,
"cross-env"
:
"^1.0.6"
,
"css-loader"
:
"^0.23.1"
,
"file-loader"
:
"^0.8.5"
,
"style-loader"
:
"^0.13.1"
,
"vue-loader"
:
"^9.8.0"
,
"webpack"
:
"beta"
,
"webpack-dev-server"
:
"beta"
}
}
```
<br>
**webpack.config.js**
```
javascript
var
path
=
require
(
'
path
'
)
var
webpack
=
require
(
'
webpack
'
)
module
.
exports
=
{
entry
:
'
./src/main.js
'
,
output
:
{
path
:
path
.
resolve
(
__dirname
,
'
./dist
'
),
publicPath
:
'
/dist/
'
,
filename
:
'
build.js
'
},
module
:
{
loaders
:
[
{
test
:
/
\.
vue$/
,
loader
:
'
vue-loader
'
},
{
test
:
/
\.
js$/
,
loader
:
'
babel-loader
'
,
exclude
:
/node_modules/
},
{
test
:
/
\.
css$/
,
loader
:
'
style-loader!css-loader
'
},
{
test
:
/
\.(
eot|svg|ttf|woff|woff2
)(\?\S
*
)?
$/
,
loader
:
'
file-loader
'
},
{
test
:
/
\.(
png|jpe
?
g|gif|svg
)(\?\S
*
)?
$/
,
loader
:
'
file-loader
'
,
query
:
{
name
:
'
[name].[ext]?[hash]
'
}
}
]
},
devServer
:
{
historyApiFallback
:
true
,
noInfo
:
true
},
devtool
:
'
#eval-source-map
'
}
if
(
process
.
env
.
NODE_ENV
===
'
production
'
)
{
module
.
exports
.
devtool
=
'
#source-map
'
// http://vue-loader.vuejs.org/en/workflow/production.html
module
.
exports
.
plugins
=
(
module
.
exports
.
plugins
||
[]).
concat
([
new
webpack
.
DefinePlugin
({
'
process.env
'
:
{
NODE_ENV
:
'
"production"
'
}
}),
new
webpack
.
optimize
.
UglifyJsPlugin
({
compress
:
{
warnings
:
false
}
})
])
}
```
shell
>
npm i
-g
vue-cli
>
mkdir
my-project
&&
cd
my-project
>
vue init webpack
>
npm i
&&
npm i element-ui
```
### Import Element
...
...
examples/docs/zh-CN/installation.md
View file @
cee31543
...
...
@@ -4,21 +4,21 @@
推荐使用 npm 的方式安装,它能更好地和
[
webpack
](
https://webpack.js.org/
)
打包工具配合使用。
```
shell
npm i element-ui
@next
-S
npm i element-ui
-S
```
### CDN
目前可以通过
[
unpkg.com/element-ui
](
https://unpkg.com/element-ui
@next
/
)
获取到最新版本的资源,在页面上引入 js 和 css 文件即可开始使用。
目前可以通过
[
unpkg.com/element-ui
](
https://unpkg.com/element-ui/
)
获取到最新版本的资源,在页面上引入 js 和 css 文件即可开始使用。
```
html
<!-- 引入样式 -->
<link
rel=
"stylesheet"
href=
"https://unpkg.com/element-ui
@next
/lib/theme-chalk/index.css"
>
<link
rel=
"stylesheet"
href=
"https://unpkg.com/element-ui/lib/theme-chalk/index.css"
>
<!-- 引入组件库 -->
<script
src=
"https://unpkg.com/element-ui
@next
/lib/index.js"
></script>
<script
src=
"https://unpkg.com/element-ui/lib/index.js"
></script>
```
### Hello world
通过 CDN 的方式我们可以很容易地使用 Element 写出一个 Hello world 页面。
[
在线演示
](
https://jsfiddle.net/
leopoldthecuber/hzfpyvg6/1
/
)
通过 CDN 的方式我们可以很容易地使用 Element 写出一个 Hello world 页面。
[
在线演示
](
https://jsfiddle.net/
hzfpyvg6/14
/
)
```
html
<!DOCTYPE html>
...
...
@@ -26,7 +26,7 @@ npm i element-ui@next -S
<head>
<meta
charset=
"UTF-8"
>
<!-- 引入样式 -->
<link
rel=
"stylesheet"
href=
"https://unpkg.com/element-ui
@next
/lib/theme-chalk/index.css"
>
<link
rel=
"stylesheet"
href=
"https://unpkg.com/element-ui/lib/theme-chalk/index.css"
>
</head>
<body>
<div
id=
"app"
>
...
...
@@ -39,7 +39,7 @@ npm i element-ui@next -S
<!-- 先引入 Vue -->
<script
src=
"https://unpkg.com/vue/dist/vue.js"
></script>
<!-- 引入组件库 -->
<script
src=
"https://unpkg.com/element-ui
@next
/lib/index.js"
></script>
<script
src=
"https://unpkg.com/element-ui/lib/index.js"
></script>
<script>
new
Vue
({
el
:
'
#app
'
,
...
...
examples/docs/zh-CN/quickstart.md
View file @
cee31543
...
...
@@ -6,123 +6,15 @@
整理中。
### 配置文件
新建项目,项目结构为
```
text
|- src/ --------------------- 项目源代码
|- App.vue
|- main.js -------------- 入口文件
|- .babelrc ----------------- babel 配置文件
|- index.html --------------- HTML 模板
|- package.json ------------- npm 配置文件
|- README.md ---------------- 项目帮助文档
|- webpack.config.js -------- webpack 配置文件
```
### 使用 vue-cli
几个配置文件的典型配置
如下:
我们推荐使用
[
vue-cli
](
https://github.com/vuejs/vue-cli
)
初始化项目,命令
如下:
**.babelrc**
```
json
{
"presets"
:
[
"vue-app"
]
}
```
<br>
**package.json**
```
json
{
"name"
:
"element-starter"
,
"scripts"
:
{
"dev"
:
"cross-env NODE_ENV=development webpack-dev-server --inline --hot --port 8086"
,
"build"
:
"cross-env NODE_ENV=production webpack --progress --hide-modules"
},
"dependencies"
:
{
"element-ui"
:
"next"
,
"vue"
:
"^2.4.2"
},
"devDependencies"
:
{
"babel-core"
:
"^6.0.0"
,
"babel-loader"
:
"^6.0.0"
,
"babel-preset-vue-app"
:
"^1.2.0"
,
"cross-env"
:
"^1.0.6"
,
"css-loader"
:
"^0.23.1"
,
"file-loader"
:
"^0.8.5"
,
"style-loader"
:
"^0.13.1"
,
"vue-loader"
:
"^9.8.0"
,
"webpack"
:
"beta"
,
"webpack-dev-server"
:
"beta"
}
}
```
<br>
**webpack.config.js**
```
javascript
var
path
=
require
(
'
path
'
)
var
webpack
=
require
(
'
webpack
'
)
module
.
exports
=
{
entry
:
'
./src/main.js
'
,
output
:
{
path
:
path
.
resolve
(
__dirname
,
'
./dist
'
),
publicPath
:
'
/dist/
'
,
filename
:
'
build.js
'
},
module
:
{
loaders
:
[
{
test
:
/
\.
vue$/
,
loader
:
'
vue-loader
'
},
{
test
:
/
\.
js$/
,
loader
:
'
babel-loader
'
,
exclude
:
/node_modules/
},
{
test
:
/
\.
css$/
,
loader
:
'
style-loader!css-loader
'
},
{
test
:
/
\.(
eot|svg|ttf|woff|woff2
)(\?\S
*
)?
$/
,
loader
:
'
file-loader
'
},
{
test
:
/
\.(
png|jpe
?
g|gif|svg
)(\?\S
*
)?
$/
,
loader
:
'
file-loader
'
,
query
:
{
name
:
'
[name].[ext]?[hash]
'
}
}
]
},
devServer
:
{
historyApiFallback
:
true
,
noInfo
:
true
},
devtool
:
'
#eval-source-map
'
}
if
(
process
.
env
.
NODE_ENV
===
'
production
'
)
{
module
.
exports
.
devtool
=
'
#source-map
'
// http://vue-loader.vuejs.org/en/workflow/production.html
module
.
exports
.
plugins
=
(
module
.
exports
.
plugins
||
[]).
concat
([
new
webpack
.
DefinePlugin
({
'
process.env
'
:
{
NODE_ENV
:
'
"production"
'
}
}),
new
webpack
.
optimize
.
UglifyJsPlugin
({
compress
:
{
warnings
:
false
}
})
])
}
```
shell
>
npm i
-g
vue-cli
>
mkdir
my-project
&&
cd
my-project
>
vue init webpack
>
npm i
&&
npm i element-ui
```
### 引入 Element
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment