mirror of
https://github.com/ElemeFE/element.git
synced 2025-12-16 11:44:01 +08:00
Compare commits
103 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
35b979da54 | ||
|
|
2e931cff96 | ||
|
|
a49dd868a4 | ||
|
|
d7dd6cecb4 | ||
|
|
c6d6b32c5e | ||
|
|
37510831ca | ||
|
|
528067f3cd | ||
|
|
3da91213ce | ||
|
|
897ec4650c | ||
|
|
deaee6ce7a | ||
|
|
07b8ec030f | ||
|
|
69b65037eb | ||
|
|
3861c55f86 | ||
|
|
0a31868b5f | ||
|
|
4e423144a2 | ||
|
|
4ebdd6a6d4 | ||
|
|
ffc136fa8d | ||
|
|
904a739499 | ||
|
|
10cef46012 | ||
|
|
bd8bf7bf35 | ||
|
|
012c0185f2 | ||
|
|
402a9abacb | ||
|
|
bd7a4252a3 | ||
|
|
fe44366fce | ||
|
|
077c0cf73f | ||
|
|
4dfb12a98e | ||
|
|
d56ac5d3ae | ||
|
|
11eaa98ac7 | ||
|
|
c9ff94e267 | ||
|
|
fc41cf4077 | ||
|
|
33ba9f5b0b | ||
|
|
a13b49b609 | ||
|
|
faa27b9d99 | ||
|
|
3003aaa426 | ||
|
|
7b263b89ae | ||
|
|
00cfee91bf | ||
|
|
edeae0a2a4 | ||
|
|
a9703bb05c | ||
|
|
99eb9366eb | ||
|
|
7dcbc9add2 | ||
|
|
7a6cea0083 | ||
|
|
cb6c54b405 | ||
|
|
f7d2d720f4 | ||
|
|
d3a32d7343 | ||
|
|
d51635ae22 | ||
|
|
4f29fc5534 | ||
|
|
dd08623526 | ||
|
|
63b465086d | ||
|
|
bca5fc1868 | ||
|
|
b13bda7bcd | ||
|
|
77ef3836b1 | ||
|
|
2053742e90 | ||
|
|
91c2940878 | ||
|
|
ea4e61ad40 | ||
|
|
fa5342ecf0 | ||
|
|
ffff83d094 | ||
|
|
f454d31378 | ||
|
|
bc19f4f757 | ||
|
|
aa05aeda6a | ||
|
|
1239c98511 | ||
|
|
c352961592 | ||
|
|
4c60c3e055 | ||
|
|
bc04f949a3 | ||
|
|
a48838d08e | ||
|
|
212cbf7a7b | ||
|
|
4addc0adb3 | ||
|
|
0a54bd41f1 | ||
|
|
1dad71e170 | ||
|
|
6ac93e0bd2 | ||
|
|
0e35ab2e62 | ||
|
|
a93d912e63 | ||
|
|
11d7da076d | ||
|
|
d33d580948 | ||
|
|
51acff04d7 | ||
|
|
abe49ffb4a | ||
|
|
a346a6b4d0 | ||
|
|
be00a80807 | ||
|
|
70449b73f4 | ||
|
|
7345ca7dfc | ||
|
|
c823c84f6f | ||
|
|
7b1b3b4e29 | ||
|
|
3bfa92ce4b | ||
|
|
9f1c7af400 | ||
|
|
87e171d300 | ||
|
|
51ec650221 | ||
|
|
b090d3eafb | ||
|
|
2bd5a61790 | ||
|
|
98c9cca24c | ||
|
|
5f496b36e0 | ||
|
|
3e3a330758 | ||
|
|
8177d0612c | ||
|
|
c9e180ff50 | ||
|
|
97eb762596 | ||
|
|
463747f977 | ||
|
|
020b9ea459 | ||
|
|
2308c321c1 | ||
|
|
d4aa5197af | ||
|
|
c29f63ac8b | ||
|
|
e84a50700b | ||
|
|
02828ed239 | ||
|
|
6a8fe43900 | ||
|
|
48783a3810 | ||
|
|
27affb22c0 |
2
.github/CONTRIBUTING.md
vendored
2
.github/CONTRIBUTING.md
vendored
@@ -26,6 +26,8 @@ Element UI 的成长离不开大家的支持,如果你愿意为 Element UI 贡
|
||||
|
||||
- 提交 PR 前请 rebase,确保 commit 记录的整洁。
|
||||
|
||||
- 确保 PR 是提交到 `dev` 分支,而不是 `master` 分支。
|
||||
|
||||
- 如果是修复 bug,请在 PR 中给出描述信息。
|
||||
|
||||
- 合并代码需要两名维护人员参与:一人进行 review 后 approve,另一人再次 review,通过后即可合并。
|
||||
|
||||
1
.github/PULL_REQUEST_TEMPLATE.md
vendored
1
.github/PULL_REQUEST_TEMPLATE.md
vendored
@@ -1,5 +1,6 @@
|
||||
Please makes sure these boxes are checked before submitting your PR, thank you!
|
||||
|
||||
* [ ] Make sure you follow Element's [Contributing Guide](https://github.com/ElemeFE/element/blob/master/.github/CONTRIBUTING.md).
|
||||
* [ ] Make sure you are merging your commits to `dev` branch.
|
||||
* [ ] Rebase before creating a PR to keep commit history clear.
|
||||
* [ ] Add some descriptions and refer relative issues for you PR.
|
||||
|
||||
@@ -1,5 +1,21 @@
|
||||
## Changelog
|
||||
|
||||
### 1.0.2
|
||||
|
||||
*2016-11-18*
|
||||
|
||||
- Added `context` for Table to specify which context to access inside of table columns, #1161
|
||||
- Added multiple languages
|
||||
- Fixed language's dynamic switching issue, #1160
|
||||
- Added `render-content` for Alert, #568
|
||||
- Added styles for focused Button, #982
|
||||
- Fixed `change` triggering timing in Switch, #1162
|
||||
- Fixed TimeSelect being disabled when start time is set to `00:00`, #676
|
||||
- Added `show-header` attribute and `header-click` method for Table, #1195
|
||||
- Improved `height` attribute for Table when set to a string, #1195
|
||||
- Fixed `selection-change` of Table not triggering in some cases, #1198
|
||||
- Fixed Table's fixed columns not disappear when `fixed` attribute is dynamically changed, #1182
|
||||
|
||||
### 1.0.1
|
||||
|
||||
*2016-11-16*
|
||||
@@ -23,7 +39,7 @@
|
||||
- Fixed DiatePicker not refresh year when switched in month picker, #1070
|
||||
- Added $loading service
|
||||
- Added `manual` trigger in Popover
|
||||
- Added props: `nodeKey` `emptyText` `checkStrictly` `defaultExpandAll` `autoExpandParent` `defaultCheckedKeys` `defaultExpandedKeys` and method: `setCheckedNodes` for Tree
|
||||
- Added props: `nodeKey`, `emptyText`, `checkStrictly`, `defaultExpandAll`, `autoExpandParent`, `defaultCheckedKeys`, `defaultExpandedKeys` and method: `setCheckedNodes` for Tree
|
||||
|
||||
### 1.0.0
|
||||
|
||||
|
||||
@@ -1,5 +1,20 @@
|
||||
## 更新日志
|
||||
|
||||
### 1.0.2
|
||||
*2016-11-18*
|
||||
|
||||
- 新增 Table `context` 属性,可以指定自定义 column 内部可获取的上下文,#1161
|
||||
- 新增 多种语言支持
|
||||
- 修复 没有正确动态渲染语言的问题,#1160
|
||||
- 新增 Alert 的 `render-content` 属性,#568
|
||||
- 新增 Button 的 focus 样式,#982
|
||||
- 修复 Switch 的 `change` 事件触发时机错误的问题,#1162
|
||||
- 修复 TimeSelect 开始时间设置 `00:00` 后会被禁用的问题,#676
|
||||
- 新增 Table `show-header` 属性,`header-click` 事件。#1195
|
||||
- 完善 Table 的 `height` 属性,当 `height` 属性为字符串的时候,表示 Table 的高度受外部样式控制,#1195
|
||||
- 修复 Table 的 `selection-change` 在某些情况下不触发的问题,#1198
|
||||
- 修复 Table 动态修改 `fixed` 属性可能会造成锁定列不消失的问题,#1182
|
||||
|
||||
### 1.0.1
|
||||
*2016-11-16*
|
||||
|
||||
@@ -23,7 +38,7 @@
|
||||
- 修复 DatePicker 月份选择器直接切换年份并未更新年份数据 #1070
|
||||
- 新增 $loading 服务,用以调用 Loading
|
||||
- 新增 Popover 可手动控制显示隐藏,将 trigger 设置为 `manual`
|
||||
- 新增 Tree 的 `nodeKey` `emptyText` `checkStrictly` `defaultExpandAll` `autoExpandParent` `defaultCheckedKeys` `defaultExpandedKeys` 属性,`setCheckedNodes` 方法。
|
||||
- 新增 Tree 的 `nodeKey`、`emptyText`、`checkStrictly`、`defaultExpandAll`、`autoExpandParent`、`defaultCheckedKeys`、`defaultExpandedKeys` 属性,`setCheckedNodes` 方法。
|
||||
|
||||
|
||||
### 1.0.0
|
||||
|
||||
2
Makefile
2
Makefile
@@ -33,7 +33,7 @@ deploy:
|
||||
@npm run deploy
|
||||
|
||||
pub:
|
||||
./node_modules/.bin/kp $(filter-out $@,$(MAKECMDGOALS))
|
||||
npm run pub
|
||||
|
||||
pub-all:
|
||||
npm run pub:all
|
||||
|
||||
@@ -39,8 +39,7 @@ module.exports = {
|
||||
version: '{{version}}',
|
||||
locale: locale.use,
|
||||
install,
|
||||
Loading: Loading.directive,
|
||||
LoadingService: Loading.service,
|
||||
Loading,
|
||||
{{list}}
|
||||
};
|
||||
`;
|
||||
|
||||
@@ -26,7 +26,7 @@ cooking.set({
|
||||
favicon: './examples/favicon.ico'
|
||||
}
|
||||
],
|
||||
publicPath: process.env.CI_ENV || '/',
|
||||
publicPath: process.env.CI_ENV || '',
|
||||
hash: true,
|
||||
devServer: {
|
||||
port: 8085,
|
||||
@@ -43,6 +43,11 @@ cooking.set({
|
||||
postcss: config.postcss
|
||||
});
|
||||
|
||||
// fix publicPath
|
||||
if (!process.env.CI_ENV) {
|
||||
cooking.add('output.publicPath', '');
|
||||
}
|
||||
|
||||
cooking.add('loader.md', {
|
||||
test: /\.md$/,
|
||||
loader: 'vue-markdown-loader'
|
||||
|
||||
@@ -1,15 +1,16 @@
|
||||
#! /bin/sh
|
||||
mkdir temp_web
|
||||
git config --global user.name "element-bot"
|
||||
git config --global user.email "wallement@gmail.com"
|
||||
|
||||
# build dev site
|
||||
if [ "$TRAVIS_BRANCH" = "master" ] && [ "$GH_TOKEN" ]; then
|
||||
npm run deploy:dev
|
||||
if [ "$ROT_TOKEN" ]; then
|
||||
npm run build:file && CI_ENV=/dev/$TRAVIS_BRANCH/ node_modules/.bin/cooking build -c build/cooking.demo.js
|
||||
cd temp_web
|
||||
git clone https://$GH_TOKEN@github.com/ElementUI/dev.git && cd dev
|
||||
git config user.name "element_bot"
|
||||
git config user.email "element_bot"
|
||||
rm -rf `find * ! -name README.md`
|
||||
cp -rf ../../examples/element-ui/** .
|
||||
git clone https://$ROT_TOKEN@github.com/ElementUI/dev.git && cd dev
|
||||
mkdir $TRAVIS_BRANCH
|
||||
rm -rf $TRAVIS_BRANCH/**
|
||||
cp -rf ../../examples/element-ui/** $TRAVIS_BRANCH/
|
||||
git add -A .
|
||||
git commit -m "$TRAVIS_COMMIT_MSG"
|
||||
git push origin master
|
||||
@@ -17,26 +18,25 @@ if [ "$TRAVIS_BRANCH" = "master" ] && [ "$GH_TOKEN" ]; then
|
||||
fi
|
||||
|
||||
# push theme-default
|
||||
if [ "$TRAVIS_BRANCH" = "master" ] && [ "$GH_TOKEN" ]; then
|
||||
if [ "$ROT_TOKEN" ]; then
|
||||
cd temp_web
|
||||
git clone https://$GH_TOKEN@github.com/ElementUI/theme-default.git && cd theme-default
|
||||
git config user.name "element_bot"
|
||||
git config user.email "element_bot"
|
||||
git clone -b $TRAVIS_BRANCH https://$ROT_TOKEN@github.com/ElementUI/theme-default.git && cd theme-default
|
||||
rm -rf *
|
||||
cp -rf ../../packages/theme-default/** .
|
||||
git add -A .
|
||||
git commit -m "$TRAVIS_COMMIT_MSG"
|
||||
git push origin master --tags
|
||||
git push origin $TRAVIS_BRANCH
|
||||
cd ../..
|
||||
fi
|
||||
|
||||
if [ "$TRAVIS_TAG" ] && [ "$GH_TOKEN" ]; then
|
||||
if [ "$TRAVIS_TAG" ] && [ "$ROT_TOKEN" ]; then
|
||||
# site sub folder
|
||||
SUB_FOLDER=$(echo $TRAVIS_TAG | grep -o -E '^\d+\.\d+')
|
||||
|
||||
# build lib
|
||||
npm run dist
|
||||
cd temp_web
|
||||
git clone https://$GH_TOKEN@github.com/ElementUI/lib.git && cd lib
|
||||
git config user.name "element_bot"
|
||||
git config user.email "element_bot"
|
||||
git clone https://$ROT_TOKEN@github.com/ElementUI/lib.git && cd lib
|
||||
rm -rf `find * ! -name README.md`
|
||||
cp -rf ../../lib/** .
|
||||
git add -A .
|
||||
@@ -47,9 +47,7 @@ if [ "$TRAVIS_TAG" ] && [ "$GH_TOKEN" ]; then
|
||||
|
||||
# build theme-default
|
||||
cd temp_web
|
||||
git clone https://$GH_TOKEN@github.com/ElementUI/theme-default.git && cd theme-default
|
||||
git config user.name "element_bot"
|
||||
git config user.email "element_bot"
|
||||
git clone https://$ROT_TOKEN@github.com/ElementUI/theme-default.git && cd theme-default
|
||||
rm -rf *
|
||||
cp -rf ../../packages/theme-default/** .
|
||||
git add -A .
|
||||
@@ -61,12 +59,14 @@ if [ "$TRAVIS_TAG" ] && [ "$GH_TOKEN" ]; then
|
||||
# build site
|
||||
npm run deploy:build
|
||||
cd temp_web
|
||||
git clone https://$GH_TOKEN@github.com/ElemeFE/element.git && cd element
|
||||
git config user.name "element_bot"
|
||||
git config user.email "element_bot"
|
||||
git checkout gh-pages
|
||||
rm -rf `find * ! -name README.md`
|
||||
git clone -b gh-pages https://$ROT_TOKEN@github.com/ElemeFE/element.git && cd element
|
||||
|
||||
# only remove files
|
||||
mkdir $SUB_FOLDER
|
||||
rm -f *
|
||||
rm -rf $SUB_FOLDER/**
|
||||
cp -rf ../../examples/element-ui/** .
|
||||
cp -rf ../../examples/element-ui/** $SUB_FOLDER/
|
||||
git add -A .
|
||||
git commit -m "$TRAVIS_COMMIT_MSG"
|
||||
git push origin gh-pages
|
||||
|
||||
19
build/git-release.sh
Normal file
19
build/git-release.sh
Normal file
@@ -0,0 +1,19 @@
|
||||
#!/usr/bin/env sh
|
||||
git checkout dev
|
||||
|
||||
if test -n "$(git status --porcelain)"; then
|
||||
echo 'Unclean working tree. Commit or stash changes first.' >&2;
|
||||
exit 128;
|
||||
fi
|
||||
|
||||
if ! git fetch --quiet 2>/dev/null; then
|
||||
echo 'There was a problem fetching your branch. Run `git fetch` to see more...' >&2;
|
||||
exit 128;
|
||||
fi
|
||||
|
||||
if test "0" != "$(git rev-list --count --left-only @'{u}'...HEAD)"; then
|
||||
echo 'Remote history differ. Please pull changes.' >&2;
|
||||
exit 128;
|
||||
fi
|
||||
|
||||
echo 'No conflicts.' >&2;
|
||||
@@ -1,3 +1,7 @@
|
||||
git checkout master
|
||||
git merge dev
|
||||
|
||||
#!/usr/bin/env sh
|
||||
set -e
|
||||
echo "Enter release version: "
|
||||
read VERSION
|
||||
@@ -24,7 +28,11 @@ then
|
||||
npm version $VERSION --message "[release] $VERSION"
|
||||
|
||||
# publish
|
||||
git push eleme refs/tags/v$VERSION
|
||||
git push eleme master
|
||||
git push eleme refs/tags/v$VERSION
|
||||
git checkout dev
|
||||
git rebase master
|
||||
git push eleme dev
|
||||
|
||||
npm publish
|
||||
fi
|
||||
|
||||
@@ -54,6 +54,7 @@
|
||||
.container,
|
||||
.page-container {
|
||||
width: 1140px;
|
||||
padding: 0 30px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
@@ -101,6 +102,13 @@
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
.container,
|
||||
.page-container {
|
||||
padding: 0 20px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
<template>
|
||||
|
||||
12
examples/assets/images/element-logo-small.svg
Normal file
12
examples/assets/images/element-logo-small.svg
Normal file
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg width="30px" height="30px" viewBox="0 0 38 48" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<!-- Generator: Sketch 40 (33762) - http://www.bohemiancoding.com/sketch -->
|
||||
<title>Shape Copy</title>
|
||||
<desc>Created with Sketch.</desc>
|
||||
<defs></defs>
|
||||
<g id="v2.2.0" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<g id="首页-默认效果-copy-2" transform="translate(-70.000000, -19.000000)" fill="#FFFFFF">
|
||||
<path d="M212.135441,45.1578077 Z M103.416502,46.2175511 C103.407008,47.7945682 102.587841,48.1463474 102.587841,48.1463474 C102.587841,48.1463474 88.4520478,56.3145087 87.5329956,56.8262751 C86.622336,57.2171561 86.0136703,56.8262751 86.0136703,56.8262751 C86.0136703,56.8262751 71.2225706,48.2479572 70.6826962,47.8708444 C70.1426843,47.4937316 70.1301643,46.9063774 70.1301643,46.9063774 C70.1301643,46.9063774 70.1450232,29.9199174 70.1301643,29.1333364 C70.1153053,28.3466177 71.0969576,27.7555461 71.0969576,27.7555461 L85.8755373,19.2134387 C86.7853714,18.7332016 87.6711286,19.2134387 87.6711286,19.2134387 C87.6711286,19.2134387 100.726623,26.8020937 102.173442,27.6177257 C103.591507,28.2919577 103.416502,29.6843424 103.416502,29.6843424 C103.416502,29.6843424 103.425307,44.7519192 103.416502,46.2175511 L103.416502,46.2175511 Z M97.5160105,29.1691339 C94.4900173,27.4274483 87.3615842,23.2971063 87.3615842,23.2971063 C87.3615842,23.2971063 86.6661039,22.9212326 85.9517747,23.2971063 L74.3487406,29.98215 C74.3487406,29.98215 73.5780025,30.4449014 73.589697,31.0604805 C73.6013915,31.6760597 73.589697,44.9698708 73.589697,44.9698708 C73.589697,44.9698708 73.5994654,45.4295932 74.0234951,45.7246472 C74.4473873,46.0197011 86.0601898,52.7332451 86.0601898,52.7332451 C86.0601898,52.7332451 86.538152,53.0391759 87.2530315,52.7332451 C87.9746526,52.3327262 99.0730335,45.9402582 99.0730335,45.9402582 C99.0730335,45.9402582 99.7162325,45.6648929 99.7236619,44.4307056 C99.7257257,44.0747959 99.7265512,42.6932881 99.7266887,40.9575229 L86.6600502,48.8752394 L86.6600502,45.846221 C86.6600502,44.6021205 87.6231289,43.7809811 87.6231289,43.7809811 L99.1807607,36.8165793 C99.6168978,36.3611251 99.7068768,35.6315447 99.7254505,35.3556287 C99.7250378,34.0904627 99.7244874,32.9852841 99.7240747,32.2851678 L86.6600502,40.2012321 L86.6600502,37.034531 C86.6600502,35.7904305 87.4855462,35.2446564 87.4855462,35.2446564 L97.5160105,29.1691339 Z" id="Shape-Copy"></path>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 2.5 KiB |
@@ -40,6 +40,7 @@
|
||||
|
||||
.container {
|
||||
height: 100%;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.footer-main {
|
||||
@@ -122,6 +123,13 @@
|
||||
margin: 10px;
|
||||
}
|
||||
}
|
||||
@media (max-width: 768px) {
|
||||
.footer {
|
||||
.footer-social {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
<script type="text/babel">
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
|
||||
.container {
|
||||
height: 100%;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
h1 {
|
||||
@@ -51,9 +52,13 @@
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
.nav-logo {
|
||||
.nav-logo,
|
||||
.nav-logo-small {
|
||||
vertical-align: sub;
|
||||
}
|
||||
.nav-logo-small {
|
||||
display: none;
|
||||
}
|
||||
.nav-item {
|
||||
margin: 0;
|
||||
float: left;
|
||||
@@ -116,6 +121,40 @@
|
||||
top: 0;
|
||||
background-color: rgba(32, 160, 255, 0);
|
||||
}
|
||||
|
||||
@media (max-width: 850px) {
|
||||
.header {
|
||||
.nav-logo {
|
||||
display: none;
|
||||
}
|
||||
.nav-logo-small {
|
||||
display: inline-block;
|
||||
}
|
||||
.nav-item {
|
||||
margin-left: 6px;
|
||||
|
||||
&:last-child {
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
||||
a {
|
||||
padding: 0 5px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@media (max-width: 700px) {
|
||||
.header {
|
||||
.container {
|
||||
padding: 0 12px;
|
||||
}
|
||||
.nav-item a,
|
||||
.nav-lang {
|
||||
font-size: 12px;
|
||||
vertical-align: top;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<template>
|
||||
<div class="headerWrapper">
|
||||
@@ -131,6 +170,10 @@
|
||||
src="../assets/images/element-logo.svg"
|
||||
alt="element-logo"
|
||||
class="nav-logo">
|
||||
<img
|
||||
src="../assets/images/element-logo-small.svg"
|
||||
alt="element-logo"
|
||||
class="nav-logo-small">
|
||||
</router-link></h1>
|
||||
<ul class="nav">
|
||||
<li class="nav-item">
|
||||
|
||||
@@ -55,10 +55,10 @@
|
||||
}
|
||||
</style>
|
||||
<template>
|
||||
<div class="side-nav">
|
||||
<div class="side-nav" :style="navStyle">
|
||||
<ul>
|
||||
<li class="nav-item" v-for="item in data">
|
||||
<a v-if="!item.path">{{item.name}}</a>
|
||||
<a v-if="!item.path" @click="expandMenu">{{item.name}}</a>
|
||||
<router-link
|
||||
v-else
|
||||
active-class="active"
|
||||
@@ -79,7 +79,7 @@
|
||||
</ul>
|
||||
<template v-if="item.groups">
|
||||
<div class="nav-group" v-for="group in item.groups">
|
||||
<div class="nav-group__title">{{group.groupName}}</div>
|
||||
<div class="nav-group__title" @click="expandMenu">{{group.groupName}}</div>
|
||||
<ul class="pure-menu-list">
|
||||
<li
|
||||
class="nav-item"
|
||||
@@ -110,8 +110,64 @@
|
||||
data() {
|
||||
return {
|
||||
highlights: [],
|
||||
navState: []
|
||||
navState: [],
|
||||
isSmallScreen: false
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
'$route.path'() {
|
||||
this.handlePathChange();
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
navStyle() {
|
||||
return this.isSmallScreen ? { 'padding-bottom': '60px' } : {};
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handleResize() {
|
||||
this.isSmallScreen = document.documentElement.clientWidth < 768;
|
||||
this.handlePathChange();
|
||||
},
|
||||
handlePathChange() {
|
||||
if (!this.isSmallScreen) {
|
||||
this.expandAllMenu();
|
||||
return;
|
||||
}
|
||||
this.$nextTick(() => {
|
||||
this.hideAllMenu();
|
||||
let activeAnchor = this.$el.querySelector('a.active');
|
||||
let ul = activeAnchor.parentNode;
|
||||
while (ul.tagName !== 'UL') {
|
||||
ul = ul.parentNode;
|
||||
}
|
||||
ul.style.height = 'auto';
|
||||
});
|
||||
},
|
||||
hideAllMenu() {
|
||||
[].forEach.call(this.$el.querySelectorAll('.pure-menu-list'), ul => {
|
||||
ul.style.height = '0';
|
||||
});
|
||||
},
|
||||
expandAllMenu() {
|
||||
[].forEach.call(this.$el.querySelectorAll('.pure-menu-list'), ul => {
|
||||
ul.style.height = 'auto';
|
||||
});
|
||||
},
|
||||
expandMenu(event) {
|
||||
if (!this.isSmallScreen) return;
|
||||
let target = event.currentTarget;
|
||||
if (!target.nextElementSibling || target.nextElementSibling.tagName !== 'UL') return;
|
||||
this.hideAllMenu();
|
||||
event.currentTarget.nextElementSibling.style.height = 'auto';
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.handleResize();
|
||||
window.addEventListener('resize', this.handleResize);
|
||||
},
|
||||
beforeDestroy() {
|
||||
window.removeEventListener('resize', this.handleResize);
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
@@ -166,6 +166,7 @@ Description includes a message with more detailed information.
|
||||
| **title** | title **REQUIRED** | string | — | — |
|
||||
| type | component type | string | success/warning/info/error | info |
|
||||
| description | supportive text | string | — | — |
|
||||
| render-content | render function for content area, overrides `description` | function(h) | — | — |
|
||||
| closable | if closable or not | boolean | — | true |
|
||||
| close-text | customized close button text | string | — | — |
|
||||
| show-icon | if a type icon is displayed | boolean | — | false |
|
||||
|
||||
@@ -63,7 +63,7 @@ node_modules/.bin/et
|
||||
By default the build theme file is placed inside `./theme`. You can specify its output directory with parameter `-o`. Importing your own theme is just like importing the default theme, only this time you import the file you just built:
|
||||
|
||||
```javascript
|
||||
import './theme/index.css'
|
||||
import '../theme/index.css'
|
||||
import ElementUI from 'element-ui'
|
||||
import Vue from 'vue'
|
||||
|
||||
|
||||
@@ -2,8 +2,9 @@
|
||||
export default {
|
||||
data() {
|
||||
var checkAge = (rule, value, callback) => {
|
||||
var age = parseInt(value, 10);
|
||||
|
||||
if (!value) {
|
||||
return callback(new Error('Please input the age'));
|
||||
}
|
||||
setTimeout(() => {
|
||||
if (!Number.isInteger(age)) {
|
||||
callback(new Error('Please input digits'));
|
||||
@@ -110,16 +111,13 @@
|
||||
},
|
||||
rules2: {
|
||||
pass: [
|
||||
{ required: true, message: 'Please input the password', trigger: 'blur' },
|
||||
{ validator: validaePass }
|
||||
{ validator: validaePass, trigger: 'blur' }
|
||||
],
|
||||
checkPass: [
|
||||
{ required: true, message: 'Please input the password again', trigger: 'blur' },
|
||||
{ validator: validaePass2 }
|
||||
{ validator: validaePass2, trigger: 'blur' }
|
||||
],
|
||||
age: [
|
||||
{ required: true, message: 'Please input the age', trigger: 'blur' },
|
||||
{ validator: checkAge, trigger: 'change' }
|
||||
{ validator: checkAge, trigger: 'change', trigger: 'blur' }
|
||||
]
|
||||
},
|
||||
dynamicForm: {
|
||||
@@ -645,8 +643,9 @@ Form component allows you to verify your data, helping you find and correct erro
|
||||
export default {
|
||||
data() {
|
||||
var checkAge = (rule, value, callback) => {
|
||||
var age = parseInt(value, 10);
|
||||
|
||||
if (!value) {
|
||||
return callback(new Error('Please input the age'));
|
||||
}
|
||||
setTimeout(() => {
|
||||
if (!Number.isInteger(age)) {
|
||||
callback(new Error('Please input digits'));
|
||||
@@ -656,10 +655,10 @@ Form component allows you to verify your data, helping you find and correct erro
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
}
|
||||
}
|
||||
}, 1000);
|
||||
};
|
||||
var validatePass = (rule, value, callback) => {
|
||||
var validaePass = (rule, value, callback) => {
|
||||
if (value === '') {
|
||||
callback(new Error('Please input the password'));
|
||||
} else {
|
||||
@@ -669,7 +668,7 @@ Form component allows you to verify your data, helping you find and correct erro
|
||||
callback();
|
||||
}
|
||||
};
|
||||
var validatePass2 = (rule, value, callback) => {
|
||||
var validaePass2 = (rule, value, callback) => {
|
||||
if (value === '') {
|
||||
callback(new Error('Please input the password again'));
|
||||
} else if (value !== this.ruleForm2.pass) {
|
||||
@@ -686,16 +685,13 @@ Form component allows you to verify your data, helping you find and correct erro
|
||||
},
|
||||
rules2: {
|
||||
pass: [
|
||||
{ required: true, message: 'Please input the password', trigger: 'blur' },
|
||||
{ validator: validatePass }
|
||||
{ validator: validaePass, trigger: 'blur' }
|
||||
],
|
||||
checkPass: [
|
||||
{ required: true, message: 'Please input the password again', trigger: 'blur' },
|
||||
{ validator: validatePass2 }
|
||||
{ validator: validaePass2, trigger: 'blur' }
|
||||
],
|
||||
age: [
|
||||
{ required: true, message: 'Please input the age', trigger: 'blur' },
|
||||
{ validator: checkAge, trigger: 'change' }
|
||||
{ validator: checkAge, trigger: 'change', trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
};
|
||||
|
||||
@@ -39,10 +39,18 @@ webpack.config.js
|
||||
|
||||
Currently Element ships with the following languages:
|
||||
<ul class="language-list">
|
||||
<li>Chinese (zh-CN)</li>
|
||||
<li>Simplified Chinese (zh-CN)</li>
|
||||
<li>English (en)</li>
|
||||
<li>German (de)</li>
|
||||
<li>Portuguese (pt)</li>
|
||||
<li>Spanish (es)</li>
|
||||
<li>Danish (da)</li>
|
||||
<li>French (fr)</li>
|
||||
<li>Norwegian (nb-NO)</li>
|
||||
<li>Traditional Chinese (zh-TW)</li>
|
||||
<li>Italian (it)</li>
|
||||
<li>Korean (ko)</li>
|
||||
<li>Japanese (ja)</li>
|
||||
</ul>
|
||||
|
||||
If your target language is not included, you are more than welcome to contribute: just add another language config [here](https://github.com/ElemeFE/element/tree/master/src/locale/lang) and create a pull request.
|
||||
|
||||
@@ -36,7 +36,7 @@ If you are using CDN, a hello-world page is easy with Element. [Online Demo](htt
|
||||
</el-dialog>
|
||||
</div>
|
||||
</body>
|
||||
<!-- import Vue before Mint UI -->
|
||||
<!-- import Vue before Element -->
|
||||
<script src="https://unpkg.com/vue/dist/vue.js"></script>
|
||||
<!-- import JavaScript -->
|
||||
<script src="https://unpkg.com/element-ui/lib/index.js"></script>
|
||||
|
||||
@@ -152,7 +152,7 @@ You can customize a text message.
|
||||
|
||||
### Full screen loading
|
||||
|
||||
Show a full screen animation while loading data.
|
||||
Show a full screen animation while loading data.
|
||||
|
||||
:::demo Add the `fullscreen` modifier to create a full screen mask, and it will append to body. In this case, if you disable scrolling on body, you add another modifier `lock`.
|
||||
|
||||
@@ -189,15 +189,15 @@ Show a full screen animation while loading data.
|
||||
### Service
|
||||
You can also invoke Loading with a service. Import Loading service:
|
||||
```javascript
|
||||
import { LoadingService } from 'element-ui';
|
||||
import { Loading } from 'element-ui';
|
||||
```
|
||||
Invoke it:
|
||||
```javascript
|
||||
LoadingService(options);
|
||||
Loading.service(options);
|
||||
```
|
||||
The parameter `options` is the configuration of Loading, and its details can be found in the following table. `LoadingService` returns a Loading instance, and you can close it by invoking its `close` method:
|
||||
```javascript
|
||||
let loadingInstance = LoadingService(options);
|
||||
let loadingInstance = Loading.service(options);
|
||||
loadingInstance.close();
|
||||
```
|
||||
If Element is imported entirely, a globally method `$loading` will be registered to Vue.prototype. You can invoke it like this: `this.$loading(options)`, and it also returns a Loading instance.
|
||||
|
||||
@@ -142,7 +142,7 @@ import ElementUI from 'element-ui'
|
||||
import 'element-ui/lib/theme-default/index.css'
|
||||
import App from './App.vue'
|
||||
|
||||
Vue.use(MintUI)
|
||||
Vue.use(ElementUI)
|
||||
|
||||
new Vue({
|
||||
el: '#app',
|
||||
|
||||
@@ -110,6 +110,17 @@
|
||||
},
|
||||
|
||||
methods: {
|
||||
handleClick() {
|
||||
console.log('click');
|
||||
},
|
||||
|
||||
handleEdit(index, row) {
|
||||
console.log(index, row);
|
||||
},
|
||||
|
||||
handleDelete(index, row) {
|
||||
console.log(index, row);
|
||||
},
|
||||
handleSelectionChange(val) {
|
||||
this.multipleSelection = val;
|
||||
},
|
||||
@@ -504,11 +515,12 @@ When there are too many columns, you can fix some of them.
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
inline-template
|
||||
:context="_self"
|
||||
fixed="right"
|
||||
label="Operations"
|
||||
width="120">
|
||||
<span>
|
||||
<el-button type="text" size="small">Detail</el-button>
|
||||
<el-button @click="handleClick" type="text" size="small">Detail</el-button>
|
||||
<el-button type="text" size="small">Edit</el-button>
|
||||
</span>
|
||||
</el-table-column>
|
||||
@@ -517,6 +529,11 @@ When there are too many columns, you can fix some of them.
|
||||
|
||||
<script>
|
||||
export default {
|
||||
methods: {
|
||||
handleClick() {
|
||||
console.log('click');
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
tableData: [{
|
||||
@@ -959,17 +976,107 @@ Filter the table to find desired data.
|
||||
```
|
||||
:::
|
||||
|
||||
### Custom column template
|
||||
|
||||
Customize table column so it can be integrated with other components.
|
||||
:::demo Activate custom column template by adding the `inline-template` attribute. By default, the context of `el-table-column` is the one where `el-table` lies, and you can customize it with the `context` attribute, e.g. `:context="_self"` refers to the current context. This is useful when sometimes Table is encapsulated into another component, and `table-column` is distributed by slots. In `el-column`, you have access to the following data: row, column, $index and store (state management of Table).
|
||||
```html
|
||||
<template>
|
||||
<el-table
|
||||
:data="tableData"
|
||||
border
|
||||
style="width: 100%">
|
||||
<el-table-column
|
||||
inline-template
|
||||
label="Date"
|
||||
width="180">
|
||||
<div>
|
||||
<el-icon name="time"></el-icon>
|
||||
<span style="margin-left: 10px">{{ row.date }}</span>
|
||||
</div>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
inline-template
|
||||
label="Name"
|
||||
width="180">
|
||||
<el-popover trigger="hover" placement="top">
|
||||
<p>Name: {{ row.name }}</p>
|
||||
<p>Addr: {{ row.address }}</p>
|
||||
<div slot="reference">
|
||||
<el-tag>{{ row.name }}</el-tag>
|
||||
</div>
|
||||
</el-popover>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
:context="_self"
|
||||
inline-template
|
||||
label="Operations">
|
||||
<div>
|
||||
<el-button
|
||||
size="small"
|
||||
@click="handleEdit($index, row)">
|
||||
Edit
|
||||
</el-button>
|
||||
<el-button
|
||||
size="small"
|
||||
type="danger"
|
||||
@click="handleDelete($index, row)">
|
||||
Delete
|
||||
</el-button>
|
||||
</div>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
tableData: [{
|
||||
date: '2016-05-03',
|
||||
name: 'Tom',
|
||||
address: 'No. 189, Grove St, Los Angeles'
|
||||
}, {
|
||||
date: '2016-05-02',
|
||||
name: 'Tom',
|
||||
address: 'No. 189, Grove St, Los Angeles'
|
||||
}, {
|
||||
date: '2016-05-04',
|
||||
name: 'Tom',
|
||||
address: 'No. 189, Grove St, Los Angeles'
|
||||
}, {
|
||||
date: '2016-05-01',
|
||||
name: 'Tom',
|
||||
address: 'No. 189, Grove St, Los Angeles'
|
||||
}]
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handleEdit(index, row) {
|
||||
console.log(index, row);
|
||||
},
|
||||
handleDelete(index, row) {
|
||||
console.log(index, row);
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
```
|
||||
:::
|
||||
|
||||
### Table Attributes
|
||||
| Attribute | Description | Type | Accepted Values | Default |
|
||||
|---------- |-------------- |---------- |-------------------------------- |-------- |
|
||||
| data | table data | array | — | — |
|
||||
| height | table's height. By default | string/number | — | — |
|
||||
| height | Table's height. By default it has an auto height. If its value is a number, the height is measured in pixels; if its value is a string, the height is affected by external styles | string/number | — | — |
|
||||
| stripe | whether table is striped | boolean | — | false |
|
||||
| border | whether table has vertical border | boolean | — | false |
|
||||
| fit | whether width of column automatically fits its container | boolean | — | true |
|
||||
| show-header | whether table header is visible | boolean | - | true |
|
||||
| highlight-current-row | whether current row is highlighted | boolean | — | false |
|
||||
| row-class-name | function that returns custom class names for a row | Function(row, index) | — | — |
|
||||
| row-key | Key of row data, used for optimizing rendering. Required if `reserve-selection` is on | Function(row)/String | — | — |
|
||||
| row-key | key of row data, used for optimizing rendering. Required if `reserve-selection` is on | Function(row)/String | — | — |
|
||||
| context | context of Table, e.g. `_self` refers to the current context, `$parent` parent context, `$root` root context, can be overridden by `context` in `el-table-column` | Object | - | current context where Table lies |
|
||||
|
||||
### Table Events
|
||||
| Event Name | Description | Parameters |
|
||||
@@ -981,6 +1088,7 @@ Filter the table to find desired data.
|
||||
| cell-mouse-leave | triggers when hovering out of a cell | row, column, cell, event |
|
||||
| cell-click | triggers when clicking a cell | row, column, cell, event |
|
||||
| row-click | triggers when clicking a row | row, event |
|
||||
| header-click | triggers when clicking a column header | column, event |
|
||||
| sort-change | triggers when Table's sorting changes | { column, prop, order } |
|
||||
| current-change | triggers when current row changes | currentRow, oldCurrentRow |
|
||||
|
||||
@@ -1005,7 +1113,8 @@ Filter the table to find desired data.
|
||||
| resizable | whether column width can be resized, works when `border` of `el-table` is `true` | boolean | — | false |
|
||||
| formatter | function that formats content | Function(row, column) | — | — |
|
||||
| show-overflow-tooltip | whether to hide extra content and show them in a tooltip when hovering on the cell | boolean | — | false |
|
||||
| inline-template | by using this attribute, you can customize column template. Row data can be accessed by `row` object, and current context can be accessed by `_self` in JSX. In this case you don't need to set `prop`. In your template, you have access to the following: `{ row (current row), column (current column), $index (row index), _self( context), store (table store) }` | — | — |
|
||||
| context | context of Table-column, e.g. `_self` refers to the current context, `$parent` parent context, `$root` root context | Object | - | current context where Table lies |
|
||||
| inline-template | by using this attribute, you can customize column template. Row data can be accessed by `row` object. In your template, you have access to the following: `{ row (current row), column (current column), $index (row index), store (table store) }` | — | — |
|
||||
| align | alignment | string | left/center/right | left |
|
||||
| class-name | class name of cells in the column | string | — | — |
|
||||
| selectable | function that determines if a certain row can be selected, works when `type` is 'selection' | Function(row, index) | — | — |
|
||||
|
||||
@@ -170,6 +170,7 @@
|
||||
| **title** | 标题,**必选参数** | string | — | — |
|
||||
| type | 主题 | string | success/warning/info/error | info |
|
||||
| description | 辅助性文字 | string | — | — |
|
||||
| render-content | 内容区域的渲染函数,会覆盖 `description` | function(h) | — | — |
|
||||
| closable | 是否可关闭 | boolean | — | true |
|
||||
| close-text | 关闭按钮自定义文本 | string | — | — |
|
||||
| show-icon | 是否显示图标 | boolean | — | false |
|
||||
|
||||
@@ -63,7 +63,7 @@ node_modules/.bin/et
|
||||
默认情况下编译的主题目录是放在 `./theme` 下,你可以通过 `-o` 参数指定打包目录。像引入默认主题一样,在代码里直接引用 `theme/index.css` 文件即可。
|
||||
|
||||
```javascript
|
||||
import './theme/index.css'
|
||||
import '../theme/index.css'
|
||||
import ElementUI from 'element-ui'
|
||||
import Vue from 'vue'
|
||||
|
||||
|
||||
@@ -2,13 +2,14 @@
|
||||
export default {
|
||||
data() {
|
||||
var checkAge = (rule, value, callback) => {
|
||||
var age = parseInt(value, 10);
|
||||
|
||||
if (!value) {
|
||||
return callback(new Error('年龄不能为空'));
|
||||
}
|
||||
setTimeout(() => {
|
||||
if (!Number.isInteger(age)) {
|
||||
if (!Number.isInteger(value)) {
|
||||
callback(new Error('请输入数字值'));
|
||||
} else{
|
||||
if (age < 18) {
|
||||
} else {
|
||||
if (value < 18) {
|
||||
callback(new Error('必须年满18岁'));
|
||||
} else {
|
||||
callback();
|
||||
@@ -110,16 +111,13 @@
|
||||
},
|
||||
rules2: {
|
||||
pass: [
|
||||
{ required: true, message: '请输入密码', trigger: 'blur' },
|
||||
{ validator: validatePass }
|
||||
{ validator: validatePass, trigger: 'blur' }
|
||||
],
|
||||
checkPass: [
|
||||
{ required: true, message: '请再次输入密码', trigger: 'blur' },
|
||||
{ validator: validatePass2 }
|
||||
{ validator: validatePass2, trigger: 'blur' }
|
||||
],
|
||||
age: [
|
||||
{ required: true, message: '请填写年龄', trigger: 'blur' },
|
||||
{ validator: checkAge, trigger: 'change' }
|
||||
{ validator: checkAge, trigger: 'blur' }
|
||||
]
|
||||
},
|
||||
dynamicForm: {
|
||||
@@ -626,7 +624,7 @@
|
||||
<el-input type="password" v-model="ruleForm2.checkPass" auto-complete="off"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="年龄" prop="age">
|
||||
<el-input v-model="ruleForm2.age"></el-input>
|
||||
<el-input v-model.number="ruleForm2.age"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="handleSubmit2">提交</el-button>
|
||||
@@ -637,13 +635,14 @@
|
||||
export default {
|
||||
data() {
|
||||
var checkAge = (rule, value, callback) => {
|
||||
var age = parseInt(value, 10);
|
||||
|
||||
if (!value) {
|
||||
return callback(new Error('年龄不能为空'));
|
||||
}
|
||||
setTimeout(() => {
|
||||
if (!Number.isInteger(age)) {
|
||||
if (!Number.isInteger(value)) {
|
||||
callback(new Error('请输入数字值'));
|
||||
} else{
|
||||
if (age < 18) {
|
||||
} else {
|
||||
if (value < 18) {
|
||||
callback(new Error('必须年满18岁'));
|
||||
} else {
|
||||
callback();
|
||||
@@ -678,16 +677,13 @@
|
||||
},
|
||||
rules2: {
|
||||
pass: [
|
||||
{ required: true, message: '请输入密码', trigger: 'blur' },
|
||||
{ validator: validatePass }
|
||||
{ validator: validatePass, trigger: 'blur' }
|
||||
],
|
||||
checkPass: [
|
||||
{ required: true, message: '请再次输入密码', trigger: 'blur' },
|
||||
{ validator: validatePass2 }
|
||||
{ validator: validatePass2, trigger: 'blur' }
|
||||
],
|
||||
age: [
|
||||
{ required: true, message: '请填写年龄', trigger: 'blur' },
|
||||
{ validator: checkAge, trigger: 'change' }
|
||||
{ validator: checkAge, trigger: 'blur' }
|
||||
]
|
||||
}
|
||||
};
|
||||
|
||||
@@ -51,10 +51,18 @@ Vue.component(Select.name, Select)
|
||||
|
||||
目前 Element 内置了以下语言:
|
||||
<ul class="language-list">
|
||||
<li>汉语(zh-CN)</li>
|
||||
<li>简体中文(zh-CN)</li>
|
||||
<li>英语(en)</li>
|
||||
<li>德语(de)</li>
|
||||
<li>葡萄牙语(pt)</li>
|
||||
<li>西班牙语(es)</li>
|
||||
<li>丹麦语(da)</li>
|
||||
<li>法语(fr)</li>
|
||||
<li>挪威语(nb-NO)</li>
|
||||
<li>繁体中文(zh-TW)</li>
|
||||
<li>意大利语(it)</li>
|
||||
<li>韩语(ko)</li>
|
||||
<li>日语(ja)</li>
|
||||
</ul>
|
||||
|
||||
如果你需要使用其他的语言,欢迎贡献 PR:只需在 [这里](https://github.com/ElemeFE/element/tree/master/src/locale/lang) 添加一个语言配置文件即可。
|
||||
|
||||
@@ -250,7 +250,7 @@
|
||||
::: demo 将 `type` 属性赋值为 'flex',可以启用 flex 布局,并可通过 `justify` 属性来指定 start, center, end, space-between, space-around 其中的值来定义子元素的排版方式。
|
||||
```html
|
||||
<el-row type="flex" class="row-bg">
|
||||
<el-col :span="6" :sm="8" :md="{span: 4, offset: 2}"><div class="grid-content bg-purple"></div></el-col>
|
||||
<el-col :span="6"><div class="grid-content bg-purple"></div></el-col>
|
||||
<el-col :span="6"><div class="grid-content bg-purple-light"></div></el-col>
|
||||
<el-col :span="6"><div class="grid-content bg-purple"></div></el-col>
|
||||
</el-row>
|
||||
|
||||
@@ -193,15 +193,15 @@
|
||||
### 服务
|
||||
Loading 还可以以服务的方式调用。引入 Loading 服务:
|
||||
```javascript
|
||||
import { LoadingService } from 'element-ui';
|
||||
import { Loading } from 'element-ui';
|
||||
```
|
||||
在需要调用时:
|
||||
```javascript
|
||||
LoadingService(options);
|
||||
Loading.service(options);
|
||||
```
|
||||
其中 `options` 参数为 Loading 的配置项,具体见下表。`LoadingService` 会返回一个 Loading 实例,可通过调用该实例的 `close` 方法来关闭它:
|
||||
```javascript
|
||||
let loadingInstance = LoadingService(options);
|
||||
let loadingInstance = Loading.service(options);
|
||||
loadingInstance.close();
|
||||
```
|
||||
如果完整引入了 Element,那么 Vue.prototype 上会有一个全局方法 `$loading`,它的调用方式为:`this.$loading(options)`,同样会返回一个 Loading 实例。
|
||||
|
||||
@@ -110,6 +110,18 @@
|
||||
},
|
||||
|
||||
methods: {
|
||||
handleClick() {
|
||||
console.log('click');
|
||||
},
|
||||
|
||||
handleEdit(index, row) {
|
||||
console.log(index, row);
|
||||
},
|
||||
|
||||
handleDelete(index, row) {
|
||||
console.log(index, row);
|
||||
},
|
||||
|
||||
handleSelectionChange(val) {
|
||||
this.multipleSelection = val;
|
||||
},
|
||||
@@ -512,11 +524,12 @@
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
inline-template
|
||||
:context="_self"
|
||||
fixed="right"
|
||||
label="操作"
|
||||
width="100">
|
||||
<span>
|
||||
<el-button type="text" size="small">查看</el-button>
|
||||
<el-button @click="handleClick" type="text" size="small">查看</el-button>
|
||||
<el-button type="text" size="small">编辑</el-button>
|
||||
</span>
|
||||
</el-table-column>
|
||||
@@ -525,6 +538,12 @@
|
||||
|
||||
<script>
|
||||
export default {
|
||||
methods: {
|
||||
handleClick() {
|
||||
console.log(1);
|
||||
}
|
||||
},
|
||||
|
||||
data() {
|
||||
return {
|
||||
tableData: [{
|
||||
@@ -962,17 +981,107 @@
|
||||
```
|
||||
:::
|
||||
|
||||
### 自定义列模板
|
||||
|
||||
自定义列的显示内容,可组合其他组件使用。
|
||||
:::demo 通过设置 `inline-template` 属性可以开启自定义模板功能,此时 `el-table-column` 的上下文指的是 `el-table` 所处的上下文,当然你可以通过 `context` 属性指定上下文环境,例如设置成 `:context="_self"` 就是指的当前上下文。有些时候我们会把 table 封装在其他组件里,通过 slot 设置 `table-column`,这样的话就要注意设置 `context`。在 column 组件内部,可以获取到 row, column, $index 和 store(table 内部的状态管理)的数据。
|
||||
```html
|
||||
<template>
|
||||
<el-table
|
||||
:data="tableData"
|
||||
border
|
||||
style="width: 100%">
|
||||
<el-table-column
|
||||
inline-template
|
||||
label="日期"
|
||||
width="180">
|
||||
<div>
|
||||
<el-icon name="time"></el-icon>
|
||||
<span style="margin-left: 10px">{{ row.date }}</span>
|
||||
</div>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
inline-template
|
||||
label="姓名"
|
||||
width="180">
|
||||
<el-popover trigger="hover" placement="top">
|
||||
<p>姓名: {{ row.name }}</p>
|
||||
<p>住址: {{ row.address }}</p>
|
||||
<div slot="reference">
|
||||
<el-tag>{{ row.name }}</el-tag>
|
||||
</div>
|
||||
</el-popover>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
:context="_self"
|
||||
inline-template
|
||||
label="操作">
|
||||
<div>
|
||||
<el-button
|
||||
size="small"
|
||||
@click="handleEdit($index, row)">
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button
|
||||
size="small"
|
||||
type="danger"
|
||||
@click="handleDelete($index, row)">
|
||||
删除
|
||||
</el-button>
|
||||
</div>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
tableData: [{
|
||||
date: '2016-05-02',
|
||||
name: '王小虎',
|
||||
address: '上海市普陀区金沙江路 1518 弄'
|
||||
}, {
|
||||
date: '2016-05-04',
|
||||
name: '王小虎',
|
||||
address: '上海市普陀区金沙江路 1517 弄'
|
||||
}, {
|
||||
date: '2016-05-01',
|
||||
name: '王小虎',
|
||||
address: '上海市普陀区金沙江路 1519 弄'
|
||||
}, {
|
||||
date: '2016-05-03',
|
||||
name: '王小虎',
|
||||
address: '上海市普陀区金沙江路 1516 弄'
|
||||
}]
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handleEdit(index, row) {
|
||||
console.log(index, row);
|
||||
},
|
||||
handleDelete(index, row) {
|
||||
console.log(index, row);
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
```
|
||||
:::
|
||||
|
||||
### Table Attributes
|
||||
| 参数 | 说明 | 类型 | 可选值 | 默认值 |
|
||||
|---------- |-------------- |---------- |-------------------------------- |-------- |
|
||||
| data | 显示的数据 | array | — | — |
|
||||
| height | table 的高度,默认高度为空,即自动高度,单位 px | string/number | — | — |
|
||||
| height | Table 的高度,默认为自动高度。如果 height 为 number 类型,单位 px;如果 height 为 string 类型,则 Table 的高度受控于外部样式。 | string/number | — | — |
|
||||
| stripe | 是否为斑马纹 table | boolean | — | false |
|
||||
| border | 是否带有纵向边框 | boolean | — | false |
|
||||
| fit | 列的宽度是否自撑开 | boolean | — | true |
|
||||
| show-header | 是否显示表头 | boolean | - | true |
|
||||
| highlight-current-row | 是否要高亮当前行 | boolean | — | false |
|
||||
| row-class-name | 行的 className 的回调。 | Function(row, index) | — | — |
|
||||
| row-key | 行数据的 Key,用来优化 Table 的渲染;在使用 reserve-selection 功能的情况下,该属性是必填的 | Function(row)/String | — | — |
|
||||
| context | 设置上下文环境,例如设置当前上下文就是 `_self`,父级就是 `$parent`,根组件 `$root`。优先读取 column 的 context 属性。 | Object | - | Table 所处上下文 |
|
||||
|
||||
### Table Events
|
||||
| 事件名 | 说明 | 参数 |
|
||||
@@ -984,6 +1093,7 @@
|
||||
| cell-mouse-leave | 当单元格 hover 退出时会触发该事件 | row, column, cell, event |
|
||||
| cell-click | 当某个单元格被点击时会触发该事件 | row, column, cell, event |
|
||||
| row-click | 当某一行被点击时会触发该事件 | row, event |
|
||||
| header-click | 当某一列的表头被点击时会触发该事件 | column, event |
|
||||
| sort-change | 当表格的排序条件发生变化的时候会触发该事件 | { column, prop, order } |
|
||||
| current-change | 当表格的当前行发生变化的时候会触发该事件,如果要高亮当前行,请打开表格的 highlight-current-row 属性 | currentRow, oldCurrentRow |
|
||||
|
||||
@@ -1008,7 +1118,8 @@
|
||||
| resizable | 对应列是否可以通过拖动改变宽度(需要在 el-table 上设置 border 属性为真) | boolean | — | true |
|
||||
| formatter | 用来格式化内容 | Function(row, column) | — | — |
|
||||
| show-overflow-tooltip | 当内容过长被隐藏时显示 tooltip | Boolean | — | false |
|
||||
| inline-template | 指定该属性后可以自定义 column 模板,参考多选的时间列,通过 row 获取行信息,JSX 里通过 _self 获取当前上下文。此时不需要配置 prop 属性。总共可以获取到 `{ row(当前行), column(当前列), $index(行数), _self(当前上下文), store(table store) }` 的信息。 | — | — |
|
||||
| context | 设置上下文环境,例如设置当前上下文就是 `_self`,父级就是 `$parent`,根组件 `$root` | Object | - | Table 所处上下文 |
|
||||
| inline-template | 指定该属性后可以自定义 column 模板,参考多选的时间列,通过 row 获取行信息。总共可以获取到 `{ row(当前行), column(当前列), $index(行数), store(table store) }` 以及 Table 所处的上下文环境。 | — | — |
|
||||
| align | 对齐方式 | String | left, center, right | left |
|
||||
| class-name | 列的 className | string | — | — |
|
||||
| selectable | 仅对 type=selection 的列有效,类型为 Function,Function 的返回值用来决定这一行的 CheckBox 是否可以勾选 | Function(row, index) | — | — |
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
"lang": "zh-CN",
|
||||
"pages": {
|
||||
"index": {
|
||||
"lang": "zh-CN",
|
||||
"titleSize": "46",
|
||||
"theatreSize": "46",
|
||||
"paraHeight": "1.8",
|
||||
@@ -96,6 +97,7 @@
|
||||
"lang": "en-US",
|
||||
"pages": {
|
||||
"index": {
|
||||
"lang": "en-US",
|
||||
"titleSize": "50",
|
||||
"theatreSize": "42",
|
||||
"paraHeight": "1.6",
|
||||
|
||||
@@ -2,12 +2,13 @@
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
|
||||
<link rel="stylesheet" href="//at.alicdn.com/t/font_1473762766_7074292.css">
|
||||
<title>Element</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"></div><% if (process.env.NODE_ENV === 'production') { %>
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/vue/2.0.5/vue.runtime.min.js"></script>
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/vue/2.0.7/vue.runtime.min.js"></script>
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/vue-router/2.0.1/vue-router.min.js"></script><% } %>
|
||||
</body>
|
||||
<% if (process.env.NODE_ENV === 'production') { %><script>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<style>
|
||||
.page-component {
|
||||
padding-bottom: 95px;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.page-component {
|
||||
.content {
|
||||
@@ -41,10 +42,10 @@
|
||||
<template>
|
||||
<div class="page-container page-component">
|
||||
<el-row>
|
||||
<el-col :span="6">
|
||||
<el-col :xs="24" :sm="6">
|
||||
<side-nav :data="navsData[lang]" :base="`/${ lang }/component`"></side-nav>
|
||||
</el-col>
|
||||
<el-col :span="18">
|
||||
<el-col :xs="24" :sm="18">
|
||||
<router-view class="content"></router-view>
|
||||
<footer-nav></footer-nav>
|
||||
</el-col>
|
||||
|
||||
@@ -28,28 +28,28 @@
|
||||
<div>
|
||||
<h2><%= 1 ></h2>
|
||||
<el-row :gutter="14" class="cards">
|
||||
<el-col :span="6">
|
||||
<el-col :xs="12" :sm="6">
|
||||
<div class="card">
|
||||
<img src="~examples/assets/images/consistency.png" alt="Consistency">
|
||||
<h4><%= 2 ></h4>
|
||||
<span><%= 3 ></span>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-col :xs="12" :sm="6">
|
||||
<div class="card">
|
||||
<img src="~examples/assets/images/feedback.png" alt="Feedback">
|
||||
<h4><%= 4 ></h4>
|
||||
<span><%= 5 ></span>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-col :xs="12" :sm="6">
|
||||
<div class="card">
|
||||
<img src="~examples/assets/images/efficiency.png" alt="Efficiency">
|
||||
<h4><%= 6 ></h4>
|
||||
<span><%= 7 ></span>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<el-col :xs="12" :sm="6">
|
||||
<div class="card">
|
||||
<img src="~examples/assets/images/controllability.png" alt="Controllability">
|
||||
<h4><%= 8 ></h4>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<style>
|
||||
.page-guide {
|
||||
padding: 55px 0 95px;
|
||||
padding: 55px 30px 95px;
|
||||
box-sizing: border-box;
|
||||
|
||||
.content {
|
||||
padding-left: 25px;
|
||||
@@ -48,14 +49,22 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
.page-guide {
|
||||
.content {
|
||||
padding-left: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<template>
|
||||
<div class="page-container page-guide">
|
||||
<el-row>
|
||||
<el-col :span="5">
|
||||
<el-col :xs="24" :sm="5">
|
||||
<side-nav :data="navsData" :base="`/${ lang }/guide`"></side-nav>
|
||||
</el-col>
|
||||
<el-col :span="19">
|
||||
<el-col :xs="24" :sm="19">
|
||||
<router-view class="content"></router-view>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
@@ -55,7 +55,7 @@
|
||||
font-size: <%= titleSize >px;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
|
||||
p {
|
||||
font-size: 14px;
|
||||
opacity: .8;
|
||||
@@ -136,7 +136,6 @@
|
||||
display: block;
|
||||
|
||||
&:hover {
|
||||
background-color: #20a0ff;
|
||||
color: #fff;
|
||||
background: #20a0ff;
|
||||
}
|
||||
@@ -153,6 +152,52 @@
|
||||
@media (max-width: 1140px) {
|
||||
.cards {
|
||||
width: 100%;
|
||||
.container {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
.banner .container {
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.banner img {
|
||||
right: 0;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 1000px) {
|
||||
.banner .container {
|
||||
img {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
.cards {
|
||||
li {
|
||||
width: 80%;
|
||||
margin: 0 auto 20px;
|
||||
float: none;
|
||||
}
|
||||
.card {
|
||||
height: auto;
|
||||
padding-bottom: 54px;
|
||||
}
|
||||
}
|
||||
.banner-stars {
|
||||
display: none;
|
||||
}
|
||||
.banner-desc {
|
||||
#line2 {
|
||||
display: none;
|
||||
}
|
||||
h2 {
|
||||
font-size: 32px;
|
||||
}
|
||||
p {
|
||||
width: auto;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -179,7 +224,7 @@
|
||||
<p><%= 4 ></p>
|
||||
<router-link
|
||||
active-class="active"
|
||||
to="/guide/design"
|
||||
to="/<%= lang >/guide/design"
|
||||
exact><%= 5 >
|
||||
</router-link>
|
||||
</div>
|
||||
@@ -191,7 +236,7 @@
|
||||
<p><%= 7 ></p>
|
||||
<router-link
|
||||
active-class="active"
|
||||
to="/component/layout"
|
||||
to="/<%= lang >/component/layout"
|
||||
exact><%= 5 >
|
||||
</router-link>
|
||||
</div>
|
||||
@@ -202,8 +247,8 @@
|
||||
<h3><%= 8 ></h3>
|
||||
<p><%= 9 ></p>
|
||||
<router-link
|
||||
active-class="active"
|
||||
to="/resource"
|
||||
active-class="active"
|
||||
to="/<%= lang >/resource"
|
||||
exact><%= 5 >
|
||||
</router-link>
|
||||
</div>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<style scoped>
|
||||
.page-resource {
|
||||
padding-top: 55px;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.cards {
|
||||
margin: 35px auto 110px;
|
||||
@@ -76,6 +77,23 @@
|
||||
margin-top: 20px;
|
||||
}
|
||||
}
|
||||
@media (max-width: 850px) {
|
||||
.cards {
|
||||
li {
|
||||
max-width: 500px;
|
||||
float: none;
|
||||
margin: 10px auto 30px;
|
||||
width: 80%;
|
||||
.card {
|
||||
height: auto;
|
||||
padding-bottom: 20px;
|
||||
}
|
||||
}
|
||||
h3 {
|
||||
height: auto;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<template>
|
||||
<div class="page-container page-resource">
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "element-ui",
|
||||
"version": "1.0.1",
|
||||
"version": "1.0.2",
|
||||
"description": "A Component Library for Vue.js.",
|
||||
"main": "lib/element-ui.common.js",
|
||||
"files": [
|
||||
@@ -16,14 +16,13 @@
|
||||
"clean": "rimraf lib && rimraf packages/*/lib && rimraf test/**/coverage && lerna clean --yes",
|
||||
"deploy": "npm run deploy:build && gh-pages -d examples/element-ui --remote eleme && del examples/element-ui",
|
||||
"deploy:build": "npm run build:file && cooking build -c build/cooking.demo.js -p && echo element.eleme.io>>examples/element-ui/CNAME",
|
||||
"deploy:dev": "npm run build:file && CI_ENV=/dev/ cooking build -c build/cooking.demo.js",
|
||||
"dev": "npm run bootstrap && npm run build:file && cooking watch -c build/cooking.demo.js -p",
|
||||
"dev:play": "npm run build:file && cross-env PLAY_ENV=true cooking watch -c build/cooking.demo.js -p",
|
||||
"dist": "npm run clean && npm run build:file && npm run lint && cooking build -c build/cooking.conf.js,build/cooking.common.js,build/cooking.component.js -p && npm run build:utils && npm run build:theme",
|
||||
"dist:all": "node build/bin/build-all.js && npm run build:theme",
|
||||
"i18n": "node build/bin/i18n.js",
|
||||
"lint": "eslint src/**/* test/**/* packages/**/*.{js,vue} build/**/* --quiet",
|
||||
"pub": "git checkout master && git pull eleme master --rebase && sh build/release.sh",
|
||||
"pub": "sh build/git-release.sh && sh build/release.sh",
|
||||
"pub:all": "npm run dist:all && lerna publish",
|
||||
"test": "npm run lint && CI_ENV=/dev/ karma start test/unit/karma.conf.js --single-run",
|
||||
"test:watch": "karma start test/unit/karma.conf.js"
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<i class="el-alert__icon" :class="[ iconClass, isBigIcon ]" v-if="showIcon"></i>
|
||||
<div class="el-alert__content">
|
||||
<span class="el-alert__title" :class="[ isBoldTitle ]" v-if="title">{{ title }}</span>
|
||||
<p class="el-alert__description" v-if="description">{{ description }}</p>
|
||||
<desc-content></desc-content>
|
||||
<i class="el-alert__closebtn" :class="{ 'is-customed': closeText !== '', 'el-icon-close': closeText === '' }" v-show="closable" @click="close()">{{closeText}}</i>
|
||||
</div>
|
||||
</div>
|
||||
@@ -45,7 +45,8 @@
|
||||
showIcon: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
renderContent: Function
|
||||
},
|
||||
|
||||
data() {
|
||||
@@ -54,6 +55,21 @@
|
||||
};
|
||||
},
|
||||
|
||||
components: {
|
||||
descContent: {
|
||||
render(h) {
|
||||
const parent = this.$parent;
|
||||
if (parent.renderContent) {
|
||||
return parent.renderContent(h);
|
||||
} else if (parent.description) {
|
||||
return <p class="el-alert__description">{ parent.description }</p>;
|
||||
} else {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
close() {
|
||||
this.visible = false;
|
||||
|
||||
@@ -113,7 +113,7 @@
|
||||
while (compareTime(current, end) <= 0) {
|
||||
result.push({
|
||||
value: current,
|
||||
disabled: compareTime(current, this.minTime || '00:00') <= 0
|
||||
disabled: compareTime(current, this.minTime || '-1:-1') <= 0
|
||||
});
|
||||
current = nextTime(current, step);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,11 @@
|
||||
import directive from './src/directive';
|
||||
import service from './src/index';
|
||||
|
||||
export default {
|
||||
install(Vue) {
|
||||
Vue.use(directive);
|
||||
Vue.prototype.$loading = service;
|
||||
},
|
||||
directive,
|
||||
service
|
||||
};
|
||||
|
||||
@@ -1,10 +1,5 @@
|
||||
import { t } from 'element-ui/src/locale';
|
||||
|
||||
const CONFIRM_TEXT = t('el.messagebox.confirm');
|
||||
const CANCEL_TEXT = t('el.messagebox.cancel');
|
||||
|
||||
const defaults = {
|
||||
title: '提示',
|
||||
title: undefined,
|
||||
message: '',
|
||||
type: '',
|
||||
showInput: false,
|
||||
@@ -22,8 +17,8 @@ const defaults = {
|
||||
confirmButtonPosition: 'right',
|
||||
confirmButtonHighlight: false,
|
||||
cancelButtonHighlight: false,
|
||||
confirmButtonText: CONFIRM_TEXT,
|
||||
cancelButtonText: CANCEL_TEXT,
|
||||
confirmButtonText: '',
|
||||
cancelButtonText: '',
|
||||
confirmButtonClass: '',
|
||||
cancelButtonClass: ''
|
||||
};
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
<transition name="msgbox-fade">
|
||||
<div class="el-message-box__wrapper" v-show="value" @click.self="handleWrapperClick">
|
||||
<div class="el-message-box">
|
||||
<div class="el-message-box__header" v-if="title !== ''">
|
||||
<div class="el-message-box__title">{{ title }}</div>
|
||||
<div class="el-message-box__header" v-if="title !== undefined">
|
||||
<div class="el-message-box__title">{{ title || t('el.messagebox.title') }}</div>
|
||||
<i class="el-message-box__close el-icon-close" @click="handleAction('cancel')" v-if="showClose"></i>
|
||||
</div>
|
||||
<div class="el-message-box__content" v-if="message !== ''">
|
||||
@@ -15,8 +15,8 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="el-message-box__btns">
|
||||
<el-button :class="[ cancelButtonClasses ]" v-show="showCancelButton" @click.native="handleAction('cancel')">{{ cancelButtonText }}</el-button>
|
||||
<el-button ref="confirm" :class="[ confirmButtonClasses ]" v-show="showConfirmButton" @click.native="handleAction('confirm')">{{ confirmButtonText }}</el-button>
|
||||
<el-button :class="[ cancelButtonClasses ]" v-show="showCancelButton" @click.native="handleAction('cancel')">{{ cancelButtonText || t('el.messagebox.cancel') }}</el-button>
|
||||
<el-button ref="confirm" :class="[ confirmButtonClasses ]" v-show="showConfirmButton" @click.native="handleAction('confirm')">{{ confirmButtonText || t('el.messagebox.confirm') }}</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -25,6 +25,7 @@
|
||||
|
||||
<script type="text/babel">
|
||||
import Popup from 'vue-popup';
|
||||
import Locale from 'element-ui/src/mixins/locale';
|
||||
import ElInput from 'element-ui/packages/input';
|
||||
import ElButton from 'element-ui/packages/button';
|
||||
import { addClass, removeClass } from 'wind-dom/src/class';
|
||||
@@ -38,7 +39,7 @@
|
||||
};
|
||||
|
||||
export default {
|
||||
mixins: [Popup],
|
||||
mixins: [Popup, Locale],
|
||||
|
||||
props: {
|
||||
modal: {
|
||||
@@ -173,7 +174,7 @@
|
||||
|
||||
data() {
|
||||
return {
|
||||
title: '',
|
||||
title: undefined,
|
||||
message: '',
|
||||
type: '',
|
||||
showInput: false,
|
||||
@@ -184,12 +185,11 @@
|
||||
inputErrorMessage: '',
|
||||
showConfirmButton: true,
|
||||
showCancelButton: false,
|
||||
confirmButtonText: t('el.messagebox.confirm'),
|
||||
cancelButtonText: t('el.messagebox.cancel'),
|
||||
confirmButtonText: '',
|
||||
cancelButtonText: '',
|
||||
confirmButtonClass: '',
|
||||
confirmButtonDisabled: false,
|
||||
cancelButtonClass: '',
|
||||
|
||||
editorErrorMessage: null,
|
||||
callback: null
|
||||
};
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
:name="name"
|
||||
:disabled="disabled"
|
||||
:readonly="!filterable || multiple"
|
||||
@click.native="toggleMenu"
|
||||
@focus="toggleMenu"
|
||||
@keyup.native="debouncedOnInputChange"
|
||||
@keydown.native.down.prevent="navigateOptions('next')"
|
||||
@keydown.native.up.prevent="navigateOptions('prev')"
|
||||
@@ -149,7 +149,9 @@
|
||||
multiple: Boolean,
|
||||
placeholder: {
|
||||
type: String,
|
||||
default: t('el.select.placeholder')
|
||||
default() {
|
||||
return t('el.select.placeholder');
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
class="el-switch__input"
|
||||
type="checkbox"
|
||||
@change="handleChange"
|
||||
v-model="currentValue"
|
||||
v-model="_value"
|
||||
:name="name"
|
||||
:disabled="disabled">
|
||||
<span class="el-switch__core" ref="core" :style="{ 'width': coreWidth + 'px' }">
|
||||
@@ -79,7 +79,6 @@
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
currentValue: this.value,
|
||||
coreWidth: this.width,
|
||||
buttonStyle: {
|
||||
transform: ''
|
||||
@@ -90,18 +89,22 @@
|
||||
hasText() {
|
||||
/* istanbul ignore next */
|
||||
return this.onText || this.offText;
|
||||
},
|
||||
_value: {
|
||||
get() {
|
||||
return this.value;
|
||||
},
|
||||
set(val) {
|
||||
this.$emit('input', val);
|
||||
}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
value(val) {
|
||||
this.currentValue = val;
|
||||
value() {
|
||||
if (this.onColor || this.offColor) {
|
||||
this.handleCoreColor();
|
||||
this.setBackgroundColor();
|
||||
}
|
||||
this.handleButtonTransform();
|
||||
},
|
||||
currentValue(val) {
|
||||
this.$emit('input', val);
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@@ -111,9 +114,10 @@
|
||||
handleButtonTransform() {
|
||||
this.buttonStyle.transform = this.value ? `translate(${ this.coreWidth - 20 }px, 2px)` : 'translate(2px, 2px)';
|
||||
},
|
||||
handleCoreColor() {
|
||||
this.$refs.core.style.borderColor = this.value ? this.onColor : this.offColor;
|
||||
this.$refs.core.style.backgroundColor = this.value ? this.onColor : this.offColor;
|
||||
setBackgroundColor() {
|
||||
let newColor = this.value ? this.onColor : this.offColor;
|
||||
this.$refs.core.style.borderColor = newColor;
|
||||
this.$refs.core.style.backgroundColor = newColor;
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
@@ -123,7 +127,7 @@
|
||||
}
|
||||
this.handleButtonTransform();
|
||||
if ((this.onColor || this.offColor) && !this.disabled) {
|
||||
this.handleCoreColor();
|
||||
this.setBackgroundColor();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -5,6 +5,7 @@ export default {
|
||||
store: {
|
||||
required: true
|
||||
},
|
||||
context: {},
|
||||
layout: {
|
||||
required: true
|
||||
},
|
||||
@@ -43,7 +44,7 @@ export default {
|
||||
on-mouseenter={ ($event) => this.handleCellMouseEnter($event, row) }
|
||||
on-mouseleave={ this.handleCellMouseLeave }>
|
||||
{
|
||||
column.renderCell.call(this._renderProxy, h, { row, column, $index, store: this.store, _self: this.$parent.$vnode.context })
|
||||
column.renderCell.call(this._renderProxy, h, { row, column, $index, store: this.store, _self: this.context || this.$parent.$vnode.context })
|
||||
}
|
||||
</td>
|
||||
)
|
||||
|
||||
@@ -100,6 +100,7 @@ export default {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
context: {},
|
||||
align: String,
|
||||
showTooltipWhenOverflow: Boolean,
|
||||
showOverflowTooltip: Boolean,
|
||||
@@ -186,6 +187,7 @@ export default {
|
||||
minWidth,
|
||||
width,
|
||||
isColumnGroup,
|
||||
context: this.context,
|
||||
align: this.align ? 'is-' + this.align : null,
|
||||
sortable: this.sortable,
|
||||
sortMethod: this.sortMethod,
|
||||
@@ -211,13 +213,18 @@ export default {
|
||||
column.renderCell = function(h, data) {
|
||||
if (_self.$vnode.data.inlineTemplate) {
|
||||
renderCell = function() {
|
||||
data._self = _self.context || data._self;
|
||||
if (Object.prototype.toString.call(data._self) === '[object Object]') {
|
||||
for (let prop in data._self) {
|
||||
if (!data.hasOwnProperty(prop)) {
|
||||
// _self.$set(data, prop, data._self[prop]);
|
||||
data[prop] = data._self[prop];
|
||||
}
|
||||
}
|
||||
}
|
||||
// 静态内容会缓存到 _staticTrees 内,不改的话获取的静态数据就不是内部 context
|
||||
data._staticTrees = _self._staticTrees;
|
||||
data.$options.staticRenderFns = _self.$options.staticRenderFns;
|
||||
return _self.customRender.call(data);
|
||||
};
|
||||
}
|
||||
|
||||
@@ -33,6 +33,7 @@ export default {
|
||||
on-mousemove={ ($event) => this.handleMouseMove($event, column) }
|
||||
on-mouseout={ this.handleMouseOut }
|
||||
on-mousedown={ ($event) => this.handleMouseDown($event, column) }
|
||||
on-click={ ($event) => this.handleClick($event, column) }
|
||||
class={ [column.id, column.order, column.align, column.className || '', this.isCellHidden(cellIndex) ? 'is-hidden' : ''] }>
|
||||
<div class={ ['cell', column.filteredValue && column.filteredValue.length > 0 ? 'highlight' : ''] }>
|
||||
{
|
||||
@@ -162,6 +163,10 @@ export default {
|
||||
}, 16);
|
||||
},
|
||||
|
||||
handleClick(event, column) {
|
||||
this.$parent.$emit('header-click', column, event);
|
||||
},
|
||||
|
||||
handleMouseDown(event, column) {
|
||||
/* istanbul ignore if */
|
||||
if (this.draggingColumn && this.border) {
|
||||
@@ -239,7 +244,7 @@ export default {
|
||||
if (!this.dragging && this.border) {
|
||||
let rect = target.getBoundingClientRect();
|
||||
|
||||
var bodyStyle = document.body.style;
|
||||
const bodyStyle = document.body.style;
|
||||
if (rect.width > 12 && rect.right - event.pageX < 8) {
|
||||
bodyStyle.cursor = 'col-resize';
|
||||
this.draggingColumn = column;
|
||||
|
||||
@@ -8,6 +8,7 @@ class TableLayout {
|
||||
this.store = null;
|
||||
this.columns = null;
|
||||
this.fit = true;
|
||||
this.showHeader = true;
|
||||
|
||||
this.height = null;
|
||||
this.scrollX = false;
|
||||
@@ -50,16 +51,21 @@ class TableLayout {
|
||||
}
|
||||
|
||||
setHeight(height) {
|
||||
if (typeof height === 'string' && /^\d+$/.test(height)) {
|
||||
height = Number(height);
|
||||
const el = this.table.$el;
|
||||
if (typeof height === 'string') {
|
||||
if (/^\d+$/.test(height)) {
|
||||
height = Number(height);
|
||||
}
|
||||
}
|
||||
|
||||
this.height = height;
|
||||
|
||||
const el = this.table.$el;
|
||||
if (!isNaN(height) && el) {
|
||||
if (!el) return;
|
||||
if (!isNaN(height)) {
|
||||
el.style.height = height + 'px';
|
||||
|
||||
this.updateHeight();
|
||||
} else if (typeof height === 'string') {
|
||||
this.updateHeight();
|
||||
}
|
||||
}
|
||||
@@ -67,12 +73,23 @@ class TableLayout {
|
||||
updateHeight() {
|
||||
const height = this.tableHeight = this.table.$el.clientHeight;
|
||||
const { headerWrapper } = this.table.$refs;
|
||||
if (!headerWrapper) return;
|
||||
const headerHeight = this.headerHeight = headerWrapper.offsetHeight;
|
||||
const bodyHeight = height - headerHeight;
|
||||
if (this.height !== null && !isNaN(this.height)) this.bodyHeight = bodyHeight;
|
||||
this.fixedBodyHeight = this.scrollX ? bodyHeight - this.gutterWidth : bodyHeight;
|
||||
this.viewportHeight = this.scrollX ? height - this.gutterWidth : height;
|
||||
if (this.showHeader && !headerWrapper) return;
|
||||
if (!this.showHeader) {
|
||||
this.headerHeight = 0;
|
||||
if (this.height !== null && (!isNaN(this.height) || typeof this.height === 'string')) {
|
||||
this.bodyHeight = height;
|
||||
}
|
||||
this.fixedBodyHeight = this.scrollX ? height - this.gutterWidth : height;
|
||||
this.viewportHeight = this.scrollX ? height - this.gutterWidth : height;
|
||||
} else {
|
||||
const headerHeight = this.headerHeight = headerWrapper.offsetHeight;
|
||||
const bodyHeight = height - headerHeight;
|
||||
if (this.height !== null && (!isNaN(this.height) || typeof this.height === 'string')) {
|
||||
this.bodyHeight = bodyHeight;
|
||||
}
|
||||
this.fixedBodyHeight = this.scrollX ? bodyHeight - this.gutterWidth : bodyHeight;
|
||||
this.viewportHeight = this.scrollX ? height - this.gutterWidth : height;
|
||||
}
|
||||
}
|
||||
|
||||
update() {
|
||||
|
||||
@@ -255,11 +255,18 @@ TableStore.prototype.isSelected = function(row) {
|
||||
TableStore.prototype.clearSelection = function() {
|
||||
const states = this.states;
|
||||
states.isAllSelected = false;
|
||||
const oldSelection = states.selection;
|
||||
states.selection = [];
|
||||
if (oldSelection.length > 0) {
|
||||
this.table.$emit('selection-change', states.selection);
|
||||
}
|
||||
};
|
||||
|
||||
TableStore.prototype.toggleRowSelection = function(row, selected) {
|
||||
toggleRowSelection(this.states, row, selected);
|
||||
const changed = toggleRowSelection(this.states, row, selected);
|
||||
if (changed) {
|
||||
this.table.$emit('selection-change', this.states.selection);
|
||||
}
|
||||
};
|
||||
|
||||
TableStore.prototype.cleanSelection = function() {
|
||||
@@ -313,21 +320,31 @@ TableStore.prototype.updateAllSelected = function() {
|
||||
};
|
||||
|
||||
let isAllSelected = true;
|
||||
let selectedCount = 0;
|
||||
for (let i = 0, j = data.length; i < j; i++) {
|
||||
const item = data[i];
|
||||
if (selectable) {
|
||||
if (selectable.call(null, item, i) && !isSelected(item)) {
|
||||
isAllSelected = false;
|
||||
break;
|
||||
const isRowSelectable = selectable.call(null, item, i);
|
||||
if (isRowSelectable) {
|
||||
if (!isSelected(item)) {
|
||||
isAllSelected = false;
|
||||
break;
|
||||
} else {
|
||||
selectedCount++;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (!isSelected(item)) {
|
||||
isAllSelected = false;
|
||||
break;
|
||||
} else {
|
||||
selectedCount++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (selectedCount === 0) isAllSelected = false;
|
||||
|
||||
states.isAllSelected = isAllSelected;
|
||||
};
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
:class="{ 'el-table--fit': fit, 'el-table--striped': stripe, 'el-table--border': border }"
|
||||
@mouseleave="handleMouseLeave($event)">
|
||||
<div class="hidden-columns" ref="hiddenColumns"><slot></slot></div>
|
||||
<div class="el-table__header-wrapper" ref="headerWrapper">
|
||||
<div class="el-table__header-wrapper" ref="headerWrapper" v-if="showHeader">
|
||||
<table-header
|
||||
:store="store"
|
||||
:layout="layout"
|
||||
@@ -14,6 +14,7 @@
|
||||
<div class="el-table__body-wrapper" ref="bodyWrapper"
|
||||
:style="{ height: layout.bodyHeight ? layout.bodyHeight + 'px' : '' }">
|
||||
<table-body
|
||||
:context="context"
|
||||
:store="store"
|
||||
:layout="layout"
|
||||
:row-class-name="rowClassName"
|
||||
@@ -25,12 +26,12 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="el-table__fixed" ref="fixedWrapper"
|
||||
v-if="fixedColumns.length > 0"
|
||||
:style="{
|
||||
width: layout.fixedWidth ? layout.fixedWidth + 'px' : '',
|
||||
height: layout.viewportHeight ? layout.viewportHeight + 'px' : ''
|
||||
}">
|
||||
<div class="el-table__fixed-header-wrapper" ref="fixedHeaderWrapper"
|
||||
v-if="fixedColumns.length > 0">
|
||||
<div class="el-table__fixed-header-wrapper" ref="fixedHeaderWrapper" v-if="showHeader">
|
||||
<table-header
|
||||
fixed="left"
|
||||
:border="border"
|
||||
@@ -39,7 +40,6 @@
|
||||
:style="{ width: layout.fixedWidth ? layout.fixedWidth + 'px' : '' }"></table-header>
|
||||
</div>
|
||||
<div class="el-table__fixed-body-wrapper" ref="fixedBodyWrapper"
|
||||
v-if="fixedColumns.length > 0"
|
||||
:style="{
|
||||
top: layout.headerHeight + 'px',
|
||||
height: layout.fixedBodyHeight ? layout.fixedBodyHeight + 'px' : ''
|
||||
@@ -55,13 +55,13 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="el-table__fixed-right" ref="rightFixedWrapper"
|
||||
v-if="rightFixedColumns.length > 0"
|
||||
:style="{
|
||||
width: layout.rightFixedWidth ? layout.rightFixedWidth + 'px' : '',
|
||||
height: layout.viewportHeight ? layout.viewportHeight + 'px' : '',
|
||||
right: layout.scrollY ? layout.gutterWidth + 'px' : ''
|
||||
}">
|
||||
<div class="el-table__fixed-header-wrapper" ref="rightFixedHeaderWrapper"
|
||||
v-if="rightFixedColumns.length > 0">
|
||||
<div class="el-table__fixed-header-wrapper" ref="rightFixedHeaderWrapper" v-if="showHeader">
|
||||
<table-header
|
||||
fixed="right"
|
||||
:border="border"
|
||||
@@ -70,7 +70,6 @@
|
||||
:style="{ width: layout.rightFixedWidth ? layout.rightFixedWidth + 'px' : '' }"></table-header>
|
||||
</div>
|
||||
<div class="el-table__fixed-body-wrapper" ref="rightFixedBodyWrapper"
|
||||
v-if="rightFixedColumns.length > 0"
|
||||
:style="{
|
||||
top: layout.headerHeight + 'px',
|
||||
height: layout.fixedBodyHeight ? layout.fixedBodyHeight + 'px' : ''
|
||||
@@ -131,13 +130,22 @@
|
||||
|
||||
rowKey: [String, Function],
|
||||
|
||||
context: {},
|
||||
|
||||
showHeader: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
|
||||
rowClassName: [String, Function],
|
||||
|
||||
highlightCurrentRow: Boolean,
|
||||
|
||||
emptyText: {
|
||||
type: String,
|
||||
default: t('el.table.emptyText')
|
||||
default() {
|
||||
return t('el.table.emptyText');
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -287,7 +295,8 @@
|
||||
const layout = new TableLayout({
|
||||
store,
|
||||
table: this,
|
||||
fit: this.fit
|
||||
fit: this.fit,
|
||||
showHeader: this.showHeader
|
||||
});
|
||||
return {
|
||||
store,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "element-theme-default",
|
||||
"version": "1.0.1",
|
||||
"version": "1.0.2",
|
||||
"description": "Element component default theme.",
|
||||
"main": "lib/index.css",
|
||||
"style": "lib/index.css",
|
||||
|
||||
@@ -23,7 +23,8 @@
|
||||
|
||||
@mixin button-size var(--button-padding-vertical), var(--button-padding-horizontal), var(--button-font-size), var(--button-border-radius);
|
||||
|
||||
&:hover {
|
||||
&:hover,
|
||||
&:focus {
|
||||
color: var(--color-primary);
|
||||
border-color: @color;
|
||||
}
|
||||
@@ -45,7 +46,8 @@
|
||||
}
|
||||
|
||||
@when plain {
|
||||
&:hover {
|
||||
&:hover,
|
||||
&:focus {
|
||||
background: #fff;
|
||||
border-color: var(--color-primary);
|
||||
color: var(--color-primary);
|
||||
@@ -66,7 +68,8 @@
|
||||
|
||||
@when disabled {
|
||||
&,
|
||||
&:hover {
|
||||
&:hover,
|
||||
&:focus {
|
||||
color: var(--button-disabled-color);
|
||||
cursor: not-allowed;
|
||||
background-image: none;
|
||||
@@ -80,7 +83,8 @@
|
||||
|
||||
&.is-plain {
|
||||
&,
|
||||
&:hover {
|
||||
&:hover,
|
||||
&:focus {
|
||||
background-color: #fff;
|
||||
border-color: #d3dce6;
|
||||
color: #C0CCDA;
|
||||
@@ -135,7 +139,8 @@
|
||||
padding-left: 0;
|
||||
padding-right: 0;
|
||||
|
||||
&:hover {
|
||||
&:hover,
|
||||
&:focus {
|
||||
color: tint(var(--color-primary), var(--button-hover-tint-percent));
|
||||
}
|
||||
&:active {
|
||||
@@ -171,6 +176,7 @@
|
||||
}
|
||||
|
||||
&:hover,
|
||||
&:focus,
|
||||
&:active {
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
@@ -32,17 +32,17 @@
|
||||
.el-col-sm-$i {
|
||||
width: calc(1 / 24 * $(i) * 100)%;
|
||||
}
|
||||
}
|
||||
.el-col-xs-offset-$i {
|
||||
margin-left: calc(1 / 24 * $(i) * 100)%;
|
||||
}
|
||||
.el-col-xs-pull-$i {
|
||||
position: relative;
|
||||
right: calc(1 / 24 * $(i) * 100)%;
|
||||
}
|
||||
.el-col-xs-push-$i {
|
||||
position: relative;
|
||||
left: calc(1 / 24 * $(i) * 100)%;
|
||||
.el-col-xs-offset-$i {
|
||||
margin-left: calc(1 / 24 * $(i) * 100)%;
|
||||
}
|
||||
.el-col-xs-pull-$i {
|
||||
position: relative;
|
||||
right: calc(1 / 24 * $(i) * 100)%;
|
||||
}
|
||||
.el-col-xs-push-$i {
|
||||
position: relative;
|
||||
left: calc(1 / 24 * $(i) * 100)%;
|
||||
}
|
||||
}
|
||||
}
|
||||
@media (min-width: 992px) {
|
||||
@@ -50,17 +50,17 @@
|
||||
.el-col-md-$i {
|
||||
width: calc(1 / 24 * $(i) * 100)%;
|
||||
}
|
||||
}
|
||||
.el-col-md-offset-$i {
|
||||
margin-left: calc(1 / 24 * $(i) * 100)%;
|
||||
}
|
||||
.el-col-md-pull-$i {
|
||||
position: relative;
|
||||
right: calc(1 / 24 * $(i) * 100)%;
|
||||
}
|
||||
.el-col-md-push-$i {
|
||||
position: relative;
|
||||
left: calc(1 / 24 * $(i) * 100)%;
|
||||
.el-col-md-offset-$i {
|
||||
margin-left: calc(1 / 24 * $(i) * 100)%;
|
||||
}
|
||||
.el-col-md-pull-$i {
|
||||
position: relative;
|
||||
right: calc(1 / 24 * $(i) * 100)%;
|
||||
}
|
||||
.el-col-md-push-$i {
|
||||
position: relative;
|
||||
left: calc(1 / 24 * $(i) * 100)%;
|
||||
}
|
||||
}
|
||||
}
|
||||
@media (min-width: 1200px) {
|
||||
@@ -68,16 +68,16 @@
|
||||
.el-col-lg-$i {
|
||||
width: calc(1 / 24 * $(i) * 100)%;
|
||||
}
|
||||
}
|
||||
.el-col-xs-offset-$i {
|
||||
margin-left: calc(1 / 24 * $(i) * 100)%;
|
||||
}
|
||||
.el-col-xs-pull-$i {
|
||||
position: relative;
|
||||
right: calc(1 / 24 * $(i) * 100)%;
|
||||
}
|
||||
.el-col-xs-push-$i {
|
||||
position: relative;
|
||||
left: calc(1 / 24 * $(i) * 100)%;
|
||||
.el-col-xs-offset-$i {
|
||||
margin-left: calc(1 / 24 * $(i) * 100)%;
|
||||
}
|
||||
.el-col-xs-pull-$i {
|
||||
position: relative;
|
||||
right: calc(1 / 24 * $(i) * 100)%;
|
||||
}
|
||||
.el-col-xs-push-$i {
|
||||
position: relative;
|
||||
left: calc(1 / 24 * $(i) * 100)%;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -99,6 +99,7 @@
|
||||
}
|
||||
|
||||
@b input-group {
|
||||
line-height: normal;
|
||||
display: table;
|
||||
border-collapse: separate;
|
||||
|
||||
|
||||
@@ -3,7 +3,8 @@
|
||||
background-color: $background-color;
|
||||
border-color: $border-color;
|
||||
|
||||
&:hover {
|
||||
&:hover,
|
||||
&:focus {
|
||||
background: tint($background-color, var(--button-hover-tint-percent));
|
||||
border-color: tint($border-color, var(--button-hover-tint-percent));
|
||||
color: $color;
|
||||
@@ -27,7 +28,8 @@
|
||||
border: var(--border-base);
|
||||
color: var(--button-default-color);
|
||||
|
||||
&:hover {
|
||||
&:hover,
|
||||
&:focus {
|
||||
background: #fff;
|
||||
border-color: $border-color;
|
||||
color: $background-color;
|
||||
|
||||
@@ -296,6 +296,7 @@
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: normal;
|
||||
word-break: break-all;
|
||||
line-height: 24px;
|
||||
padding-left: 18px;
|
||||
padding-right: 18px;
|
||||
|
||||
@@ -25,7 +25,9 @@
|
||||
},
|
||||
emptyText: {
|
||||
type: String,
|
||||
default: t('el.tree.emptyText')
|
||||
default() {
|
||||
return t('el.tree.emptyText');
|
||||
}
|
||||
},
|
||||
nodeKey: String,
|
||||
checkStrictly: Boolean,
|
||||
|
||||
@@ -131,11 +131,10 @@ if (typeof window !== 'undefined' && window.Vue) {
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
version: '1.0.1',
|
||||
version: '1.0.2',
|
||||
locale: locale.use,
|
||||
install,
|
||||
Loading: Loading.directive,
|
||||
LoadingService: Loading.service,
|
||||
Loading,
|
||||
Pagination,
|
||||
Dialog,
|
||||
Autocomplete,
|
||||
|
||||
85
src/locale/lang/da.js
Normal file
85
src/locale/lang/da.js
Normal file
@@ -0,0 +1,85 @@
|
||||
export default {
|
||||
el: {
|
||||
datepicker: {
|
||||
now: 'Nu',
|
||||
today: 'I dag',
|
||||
cancel: 'Annuller',
|
||||
clear: 'Ryd',
|
||||
confirm: 'OK',
|
||||
selectDate: 'Vælg dato',
|
||||
selectTime: 'Vælg tidspunkt',
|
||||
startDate: 'Startdato',
|
||||
startTime: 'Starttidspunkt',
|
||||
endDate: 'Slutdato',
|
||||
endTime: 'Sluttidspunkt',
|
||||
year: 'År',
|
||||
month1: 'Januar',
|
||||
month2: 'Februar',
|
||||
month3: 'Marts',
|
||||
month4: 'April',
|
||||
month5: 'Maj',
|
||||
month6: 'Juni',
|
||||
month7: 'Juli',
|
||||
month8: 'August',
|
||||
month9: 'September',
|
||||
month10: 'Oktober',
|
||||
month11: 'November',
|
||||
month12: 'December',
|
||||
week: 'uge',
|
||||
weeks: {
|
||||
sun: 'Søn',
|
||||
mon: 'Man',
|
||||
tue: 'Tir',
|
||||
wed: 'Ons',
|
||||
thu: 'Tor',
|
||||
fri: 'Fre',
|
||||
sat: 'Lør'
|
||||
},
|
||||
months: {
|
||||
jan: 'Jan',
|
||||
feb: 'Feb',
|
||||
mar: 'Mar',
|
||||
apr: 'Apr',
|
||||
may: 'Maj',
|
||||
jun: 'Jun',
|
||||
jul: 'Jul',
|
||||
aug: 'Aug',
|
||||
sep: 'Sep',
|
||||
oct: 'Okt',
|
||||
nov: 'Nov',
|
||||
dec: 'Dec'
|
||||
}
|
||||
},
|
||||
select: {
|
||||
loading: 'Henter',
|
||||
noMatch: 'Ingen matchende data',
|
||||
noData: 'Ingen data',
|
||||
placeholder: 'Vælg'
|
||||
},
|
||||
pagination: {
|
||||
goto: 'Gå til',
|
||||
pagesize: '/side',
|
||||
total: 'Total {total}',
|
||||
pageClassifier: ''
|
||||
},
|
||||
messagebox: {
|
||||
confirm: 'OK',
|
||||
cancel: 'Annuller',
|
||||
error: 'Ugyldig input'
|
||||
},
|
||||
upload: {
|
||||
delete: 'Slet',
|
||||
preview: 'Forhåndsvisning',
|
||||
continue: 'Fortsæt'
|
||||
},
|
||||
table: {
|
||||
emptyText: 'Ingen data',
|
||||
confirmFilter: 'Bekræft',
|
||||
resetFilter: 'Nulstil',
|
||||
clearFilter: 'Alle'
|
||||
},
|
||||
tree: {
|
||||
emptyText: 'Ingen data'
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -63,6 +63,7 @@ export default {
|
||||
pageClassifier: ''
|
||||
},
|
||||
messagebox: {
|
||||
title: 'Message',
|
||||
confirm: 'OK',
|
||||
cancel: 'Cancel',
|
||||
error: 'Illegal input'
|
||||
|
||||
85
src/locale/lang/es.js
Normal file
85
src/locale/lang/es.js
Normal file
@@ -0,0 +1,85 @@
|
||||
export default {
|
||||
el: {
|
||||
datepicker: {
|
||||
now: 'Ahora',
|
||||
today: 'Hoy',
|
||||
cancel: 'Cancelar',
|
||||
clear: 'Limpiar',
|
||||
confirm: 'Confirmar',
|
||||
selectDate: 'Seleccionar fecha',
|
||||
selectTime: 'Seleccionar hora',
|
||||
startDate: 'Fecha de Inicio',
|
||||
startTime: 'Hora de Inicio',
|
||||
endDate: 'Fecha Final',
|
||||
endTime: 'Hora Final',
|
||||
year: 'Año',
|
||||
month1: 'Enero',
|
||||
month2: 'Febrero',
|
||||
month3: 'Marzo',
|
||||
month4: 'Abril',
|
||||
month5: 'Mayo',
|
||||
month6: 'Junio',
|
||||
month7: 'Julio',
|
||||
month8: 'Agosto',
|
||||
month9: 'Septiembre',
|
||||
month10: 'Octubre',
|
||||
month11: 'Noviembre',
|
||||
month12: 'Diciembre',
|
||||
// week: 'semana',
|
||||
weeks: {
|
||||
sun: 'Dom',
|
||||
mon: 'Lun',
|
||||
tue: 'Mar',
|
||||
wed: 'Mié',
|
||||
thu: 'Jue',
|
||||
fri: 'Vie',
|
||||
sat: 'Sáb'
|
||||
},
|
||||
months: {
|
||||
jan: 'Ene',
|
||||
feb: 'Feb',
|
||||
mar: 'Mar',
|
||||
apr: 'Abr',
|
||||
may: 'May',
|
||||
jun: 'Jun',
|
||||
jul: 'Jul',
|
||||
aug: 'Ago',
|
||||
sep: 'Sep',
|
||||
oct: 'Oct',
|
||||
nov: 'Nov',
|
||||
dec: 'Dic'
|
||||
}
|
||||
},
|
||||
select: {
|
||||
loading: 'Cargando',
|
||||
noMatch: 'No hay datos que coincidan',
|
||||
noData: 'Sin datos',
|
||||
placeholder: 'Seleccionar'
|
||||
},
|
||||
pagination: {
|
||||
goto: 'Ir a',
|
||||
pagesize: '/pagina',
|
||||
total: 'Total {total}',
|
||||
pageClassifier: ''
|
||||
},
|
||||
messagebox: {
|
||||
confirm: 'Aceptar',
|
||||
cancel: 'Cancelar',
|
||||
error: 'Entrada inválida'
|
||||
},
|
||||
upload: {
|
||||
delete: 'Eliminar',
|
||||
preview: 'Vista Previa',
|
||||
continue: 'Continuar'
|
||||
},
|
||||
table: {
|
||||
emptyText: 'Sin Datos',
|
||||
confirmFilter: 'Confirmar',
|
||||
resetFilter: 'Limpiar',
|
||||
clearFilter: 'Todo'
|
||||
},
|
||||
tree: {
|
||||
emptyText: 'Sin Datos'
|
||||
}
|
||||
}
|
||||
};
|
||||
85
src/locale/lang/fr.js
Normal file
85
src/locale/lang/fr.js
Normal file
@@ -0,0 +1,85 @@
|
||||
export default {
|
||||
el: {
|
||||
datepicker: {
|
||||
now: 'Maintenant',
|
||||
today: 'Auj.',
|
||||
cancel: 'Annuler',
|
||||
clear: 'Effacer',
|
||||
confirm: 'OK',
|
||||
selectDate: 'Choisir date',
|
||||
selectTime: 'Choisir horaire',
|
||||
startDate: 'Date début',
|
||||
startTime: 'Horaire début',
|
||||
endDate: 'Date fin',
|
||||
endTime: 'Horaire fin',
|
||||
year: 'Année',
|
||||
month1: 'Janvier',
|
||||
month2: 'Février',
|
||||
month3: 'Mars',
|
||||
month4: 'Avril',
|
||||
month5: 'Mai',
|
||||
month6: 'Juin',
|
||||
month7: 'Juillet',
|
||||
month8: 'Août',
|
||||
month9: 'Septembre',
|
||||
month10: 'Octobre',
|
||||
month11: 'Novembre',
|
||||
month12: 'Décembre',
|
||||
// week: 'Semaine',
|
||||
weeks: {
|
||||
sun: 'Dim',
|
||||
mon: 'Lun',
|
||||
tue: 'Mar',
|
||||
wed: 'Mer',
|
||||
thu: 'Jeu',
|
||||
fri: 'Ven',
|
||||
sat: 'Sam'
|
||||
},
|
||||
months: {
|
||||
jan: 'Jan',
|
||||
feb: 'Fév',
|
||||
mar: 'Mar',
|
||||
apr: 'Avr',
|
||||
may: 'Mai',
|
||||
jun: 'Jun',
|
||||
jul: 'Jul',
|
||||
aug: 'Aoû',
|
||||
sep: 'Sep',
|
||||
oct: 'Oct',
|
||||
nov: 'Nov',
|
||||
dec: 'Déc'
|
||||
}
|
||||
},
|
||||
select: {
|
||||
loading: 'Chargement',
|
||||
noMatch: 'Aucune correspondance',
|
||||
noData: 'Aucun résultat',
|
||||
placeholder: 'Choisir'
|
||||
},
|
||||
pagination: {
|
||||
goto: 'Aller à',
|
||||
pagesize: '/page',
|
||||
total: 'Total {total}',
|
||||
pageClassifier: ''
|
||||
},
|
||||
messagebox: {
|
||||
confirm: 'Confirmer',
|
||||
cancel: 'Annuler',
|
||||
error: 'Erreur'
|
||||
},
|
||||
upload: {
|
||||
delete: 'Supprimer',
|
||||
preview: 'Aperçu',
|
||||
continue: 'Continuer'
|
||||
},
|
||||
table: {
|
||||
emptyText: 'Aucune donnée',
|
||||
confirmFilter: 'Confirmer',
|
||||
resetFilter: 'Réinitialiser',
|
||||
clearFilter: 'Tous'
|
||||
},
|
||||
tree: {
|
||||
emptyText: 'Aucune donnée'
|
||||
}
|
||||
}
|
||||
};
|
||||
85
src/locale/lang/it.js
Normal file
85
src/locale/lang/it.js
Normal file
@@ -0,0 +1,85 @@
|
||||
export default {
|
||||
el: {
|
||||
datepicker: {
|
||||
now: 'Ora',
|
||||
today: 'Oggi',
|
||||
cancel: 'Cancella',
|
||||
clear: 'Pulisci',
|
||||
confirm: 'OK',
|
||||
selectDate: 'Seleziona data',
|
||||
selectTime: 'Seleziona ora',
|
||||
startDate: 'Data inizio',
|
||||
startTime: 'Ora inizio',
|
||||
endDate: 'Data fine',
|
||||
endTime: 'Ora fine',
|
||||
year: 'Anno',
|
||||
month1: 'Gennaio',
|
||||
month2: 'Febbraio',
|
||||
month3: 'Marzo',
|
||||
month4: 'Aprile',
|
||||
month5: 'Maggio',
|
||||
month6: 'Giugno',
|
||||
month7: 'Luglio',
|
||||
month8: 'Agosto',
|
||||
month9: 'Settembre',
|
||||
month10: 'Ottobre',
|
||||
month11: 'Novembre',
|
||||
month12: 'Dicembre',
|
||||
// week: 'settimana',
|
||||
weeks: {
|
||||
sun: 'Dom',
|
||||
mon: 'Lun',
|
||||
tue: 'Mar',
|
||||
wed: 'Mer',
|
||||
thu: 'Gio',
|
||||
fri: 'Ven',
|
||||
sat: 'Sab'
|
||||
},
|
||||
months: {
|
||||
jan: 'Gen',
|
||||
feb: 'Feb',
|
||||
mar: 'Mar',
|
||||
apr: 'Apr',
|
||||
may: 'Mag',
|
||||
jun: 'Giu',
|
||||
jul: 'Lug',
|
||||
aug: 'Ago',
|
||||
sep: 'Set',
|
||||
oct: 'Ott',
|
||||
nov: 'Nov',
|
||||
dec: 'Dic'
|
||||
}
|
||||
},
|
||||
select: {
|
||||
loading: 'Caricamento',
|
||||
noMatch: 'Nessuna corrispondenza',
|
||||
noData: 'Nessun risultato',
|
||||
placeholder: 'Seleziona'
|
||||
},
|
||||
pagination: {
|
||||
goto: 'Vai a',
|
||||
pagesize: '/page',
|
||||
total: 'Totale {total}',
|
||||
pageClassifier: ''
|
||||
},
|
||||
messagebox: {
|
||||
confirm: 'OK',
|
||||
cancel: 'Cancella',
|
||||
error: 'Input non valido'
|
||||
},
|
||||
upload: {
|
||||
delete: 'Cancella',
|
||||
preview: 'Anteprima',
|
||||
continue: 'Continua'
|
||||
},
|
||||
table: {
|
||||
emptyText: 'Nessun dato',
|
||||
confirmFilter: 'Conferma',
|
||||
resetFilter: 'Reset',
|
||||
clearFilter: 'Tutti'
|
||||
},
|
||||
tree: {
|
||||
emptyText: 'Nessun dato'
|
||||
}
|
||||
}
|
||||
};
|
||||
86
src/locale/lang/ja.js
Normal file
86
src/locale/lang/ja.js
Normal file
@@ -0,0 +1,86 @@
|
||||
export default {
|
||||
el: {
|
||||
datepicker: {
|
||||
now: '今',
|
||||
today: '今日',
|
||||
cancel: 'キャンセルする',
|
||||
clear: 'クリヤー',
|
||||
confirm: 'はい',
|
||||
selectDate: '日付を入力',
|
||||
selectTime: '時間を入力',
|
||||
startDate: '開始日',
|
||||
startTime: '開始時間',
|
||||
endDate: '終了日',
|
||||
endTime: '終了時間',
|
||||
year: '年',
|
||||
month1: '一月',
|
||||
month2: '二月',
|
||||
month3: '三月',
|
||||
month4: '四月',
|
||||
month5: '五月',
|
||||
month6: '六月',
|
||||
month7: '七月',
|
||||
month8: '八月',
|
||||
month9: '九月',
|
||||
month10: '十月',
|
||||
month11: '十一月',
|
||||
month12: '十二月',
|
||||
// week: 'week',
|
||||
weeks: {
|
||||
sun: '日',
|
||||
mon: '月',
|
||||
tue: '火',
|
||||
wed: '水',
|
||||
thu: '木',
|
||||
fri: '金',
|
||||
sat: '土'
|
||||
},
|
||||
months: {
|
||||
jan: '一月',
|
||||
feb: '二月',
|
||||
mar: '三月',
|
||||
apr: '四月',
|
||||
may: '五月',
|
||||
jun: '六月',
|
||||
jul: '七月',
|
||||
aug: '八月',
|
||||
sep: '九月',
|
||||
oct: '十月',
|
||||
nov: '十一月',
|
||||
dec: '十二月'
|
||||
}
|
||||
},
|
||||
select: {
|
||||
loading: 'ロード中',
|
||||
noMatch: 'データなし',
|
||||
noData: 'データなし',
|
||||
placeholder: 'セレクター'
|
||||
},
|
||||
pagination: {
|
||||
goto: '',
|
||||
pagesize: '件/頁',
|
||||
total: '総計 {total} 件',
|
||||
pageClassifier: 'に跳ぶ'
|
||||
},
|
||||
messagebox: {
|
||||
title: 'メッセージ',
|
||||
confirm: 'はい',
|
||||
cancel: 'キャンセルする',
|
||||
error: 'エラー'
|
||||
},
|
||||
upload: {
|
||||
delete: '削除する',
|
||||
preview: 'プレビュー',
|
||||
continue: '次の件をアップロードする'
|
||||
},
|
||||
table: {
|
||||
emptyText: 'データなし',
|
||||
confirmFilter: 'フィルターする',
|
||||
resetFilter: 'リセットする',
|
||||
clearFilter: 'すべて'
|
||||
},
|
||||
tree: {
|
||||
emptyText: 'データなし'
|
||||
}
|
||||
}
|
||||
};
|
||||
86
src/locale/lang/ko.js
Normal file
86
src/locale/lang/ko.js
Normal file
@@ -0,0 +1,86 @@
|
||||
export default {
|
||||
el: {
|
||||
datepicker: {
|
||||
now: '지금',
|
||||
today: '오늘',
|
||||
cancel: '취소',
|
||||
clear: '초기화',
|
||||
confirm: '확인',
|
||||
selectDate: '날짜 선택',
|
||||
selectTime: '시간 선택',
|
||||
startDate: '시작 날짜',
|
||||
startTime: '시작 시간',
|
||||
endDate: '종료 날짜',
|
||||
endTime: '종료 시간',
|
||||
year: '년',
|
||||
month1: '1월',
|
||||
month2: '2월',
|
||||
month3: '3월',
|
||||
month4: '4월',
|
||||
month5: '5월',
|
||||
month6: '6월',
|
||||
month7: '7월',
|
||||
month8: '8월',
|
||||
month9: '9월',
|
||||
month10: '10월',
|
||||
month11: '11월',
|
||||
month12: '12월',
|
||||
// week: 'week',
|
||||
weeks: {
|
||||
sun: '일',
|
||||
mon: '월',
|
||||
tue: '화',
|
||||
wed: '수',
|
||||
thu: '목',
|
||||
fri: '금',
|
||||
sat: '토'
|
||||
},
|
||||
months: {
|
||||
jan: '1월',
|
||||
feb: '2월',
|
||||
mar: '3월',
|
||||
apr: '4월',
|
||||
may: '5월',
|
||||
jun: '6월',
|
||||
jul: '7월',
|
||||
aug: '8월',
|
||||
sep: '9월',
|
||||
oct: '10월',
|
||||
nov: '11월',
|
||||
dec: '12월'
|
||||
}
|
||||
},
|
||||
select: {
|
||||
loading: '불러오는 중',
|
||||
noMatch: '맞는 데이터가 없습니다',
|
||||
noData: '데이터 없음',
|
||||
placeholder: '선택'
|
||||
},
|
||||
pagination: {
|
||||
goto: '이동',
|
||||
pagesize: '/page',
|
||||
total: '총 {total}',
|
||||
pageClassifier: ''
|
||||
},
|
||||
messagebox: {
|
||||
title: '메시지',
|
||||
confirm: '확인',
|
||||
cancel: '취소',
|
||||
error: '올바르지 않은 입력'
|
||||
},
|
||||
upload: {
|
||||
delete: '삭제',
|
||||
preview: '미리보기',
|
||||
continue: '계속하기'
|
||||
},
|
||||
table: {
|
||||
emptyText: '데이터 없음',
|
||||
confirmFilter: '확인',
|
||||
resetFilter: '초기화',
|
||||
clearFilter: '전체'
|
||||
},
|
||||
tree: {
|
||||
emptyText: '데이터 없음'
|
||||
}
|
||||
}
|
||||
};
|
||||
85
src/locale/lang/nb-NO.js
Normal file
85
src/locale/lang/nb-NO.js
Normal file
@@ -0,0 +1,85 @@
|
||||
export default {
|
||||
el: {
|
||||
datepicker: {
|
||||
now: 'Nå',
|
||||
today: 'I dag',
|
||||
cancel: 'Avbryt',
|
||||
clear: 'Tøm',
|
||||
confirm: 'OK',
|
||||
selectDate: 'Velg dato',
|
||||
selectTime: 'Velg tidspunkt',
|
||||
startDate: 'Start Dato',
|
||||
startTime: 'Start Tidspunkt',
|
||||
endDate: 'Sluttdato',
|
||||
endTime: 'Sluttidspunkt',
|
||||
year: '',
|
||||
month1: 'Januar',
|
||||
month2: 'Februar',
|
||||
month3: 'Mars',
|
||||
month4: 'April',
|
||||
month5: 'Mai',
|
||||
month6: 'Juni',
|
||||
month7: 'Juli',
|
||||
month8: 'August',
|
||||
month9: 'September',
|
||||
month10: 'Oktober',
|
||||
month11: 'November',
|
||||
month12: 'Desember',
|
||||
// week: 'week',
|
||||
weeks: {
|
||||
sun: 'Søn',
|
||||
mon: 'Man',
|
||||
tue: 'Tir',
|
||||
wed: 'Ons',
|
||||
thu: 'Tor',
|
||||
fri: 'Fre',
|
||||
sat: 'Lør'
|
||||
},
|
||||
months: {
|
||||
jan: 'Jan',
|
||||
feb: 'Feb',
|
||||
mar: 'Mar',
|
||||
apr: 'Apr',
|
||||
may: 'Mai',
|
||||
jun: 'Jun',
|
||||
jul: 'Jul',
|
||||
aug: 'Aug',
|
||||
sep: 'Sep',
|
||||
oct: 'Okt',
|
||||
nov: 'Nov',
|
||||
dec: 'Des'
|
||||
}
|
||||
},
|
||||
select: {
|
||||
loading: 'Laster',
|
||||
noMatch: 'Ingen samsvarende data',
|
||||
noData: 'Ingen data',
|
||||
placeholder: 'Velg'
|
||||
},
|
||||
pagination: {
|
||||
goto: 'Gå til',
|
||||
pagesize: '/side',
|
||||
total: 'Total {total}',
|
||||
pageClassifier: ''
|
||||
},
|
||||
messagebox: {
|
||||
confirm: 'OK',
|
||||
cancel: 'Avbryt',
|
||||
error: 'Ugyldig input'
|
||||
},
|
||||
upload: {
|
||||
delete: 'Slett',
|
||||
preview: 'Forhåndsvisning',
|
||||
continue: 'Fortsett'
|
||||
},
|
||||
table: {
|
||||
emptyText: 'Ingen Data',
|
||||
confirmFilter: 'Bekreft',
|
||||
resetFilter: 'Tilbakestill',
|
||||
clearFilter: 'Alle'
|
||||
},
|
||||
tree: {
|
||||
emptyText: 'Ingen Data'
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -63,6 +63,7 @@ export default {
|
||||
pageClassifier: '页'
|
||||
},
|
||||
messagebox: {
|
||||
title: '提示',
|
||||
confirm: '确定',
|
||||
cancel: '取消',
|
||||
error: '输入的数据不合法!'
|
||||
|
||||
86
src/locale/lang/zh-TW.js
Normal file
86
src/locale/lang/zh-TW.js
Normal file
@@ -0,0 +1,86 @@
|
||||
export default {
|
||||
el: {
|
||||
datepicker: {
|
||||
now: '現在',
|
||||
today: '今天',
|
||||
cancel: '取消',
|
||||
clear: '清空',
|
||||
confirm: '確認',
|
||||
selectDate: '選擇日期',
|
||||
selectTime: '選擇時間',
|
||||
startDate: '開始日期',
|
||||
startTime: '開始時間',
|
||||
endDate: '結束日期',
|
||||
endTime: '結束時間',
|
||||
year: '年',
|
||||
month1: '1 月',
|
||||
month2: '2 月',
|
||||
month3: '3 月',
|
||||
month4: '4 月',
|
||||
month5: '5 月',
|
||||
month6: '6 月',
|
||||
month7: '7 月',
|
||||
month8: '8 月',
|
||||
month9: '9 月',
|
||||
month10: '10 月',
|
||||
month11: '11 月',
|
||||
month12: '12 月',
|
||||
// week: '周次',
|
||||
weeks: {
|
||||
sun: '日',
|
||||
mon: '一',
|
||||
tue: '二',
|
||||
wed: '三',
|
||||
thu: '四',
|
||||
fri: '五',
|
||||
sat: '六'
|
||||
},
|
||||
months: {
|
||||
jan: '一月',
|
||||
feb: '二月',
|
||||
mar: '三月',
|
||||
apr: '四月',
|
||||
may: '五月',
|
||||
jun: '六月',
|
||||
jul: '七月',
|
||||
aug: '八月',
|
||||
sep: '九月',
|
||||
oct: '十月',
|
||||
nov: '十一月',
|
||||
dec: '十二月'
|
||||
}
|
||||
},
|
||||
select: {
|
||||
loading: '加載中',
|
||||
noMatch: '無匹配資料',
|
||||
noData: '無資料',
|
||||
placeholder: '請選擇'
|
||||
},
|
||||
pagination: {
|
||||
goto: '前往',
|
||||
pagesize: '項/頁',
|
||||
total: '共 {total} 項',
|
||||
pageClassifier: '頁'
|
||||
},
|
||||
messagebox: {
|
||||
title: '提示',
|
||||
confirm: '確定',
|
||||
cancel: '取消',
|
||||
error: '輸入的資料不符規定!'
|
||||
},
|
||||
upload: {
|
||||
delete: '刪除',
|
||||
preview: '查看圖片',
|
||||
continue: '繼續上傳'
|
||||
},
|
||||
table: {
|
||||
emptyText: '暫無資料',
|
||||
confirmFilter: '篩選',
|
||||
resetFilter: '重置',
|
||||
clearFilter: '全部'
|
||||
},
|
||||
tree: {
|
||||
emptyText: '暫無資料'
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -1042,7 +1042,13 @@
|
||||
* @returns {Element} offset parent
|
||||
*/
|
||||
function getScrollParent(element) {
|
||||
if (element === root.document) {
|
||||
var parent = element.parentNode;
|
||||
|
||||
if (!parent) {
|
||||
return element;
|
||||
}
|
||||
|
||||
if (parent === root.document) {
|
||||
// Firefox puts the scrollTOp value on `documentElement` instead of `body`, we then check which of them is
|
||||
// greater than 0 and return the proper element
|
||||
if (root.document.body.scrollTop) {
|
||||
@@ -1054,16 +1060,16 @@
|
||||
|
||||
// Firefox want us to check `-x` and `-y` variations as well
|
||||
if (
|
||||
['scroll', 'auto'].indexOf(getStyleComputedProperty(element, 'overflow')) !== -1 ||
|
||||
['scroll', 'auto'].indexOf(getStyleComputedProperty(element, 'overflow-x')) !== -1 ||
|
||||
['scroll', 'auto'].indexOf(getStyleComputedProperty(element, 'overflow-y')) !== -1
|
||||
['scroll', 'auto'].indexOf(getStyleComputedProperty(parent, 'overflow')) !== -1 ||
|
||||
['scroll', 'auto'].indexOf(getStyleComputedProperty(parent, 'overflow-x')) !== -1 ||
|
||||
['scroll', 'auto'].indexOf(getStyleComputedProperty(parent, 'overflow-y')) !== -1
|
||||
) {
|
||||
// If the detected scrollParent is body, we perform an additional check on its parentNode
|
||||
// in this way we'll get body if the browser is Chrome-ish, or documentElement otherwise
|
||||
// fixes issue #65
|
||||
return element === root.document.body ? getScrollParent(element.parentNode) : element;
|
||||
return parent;
|
||||
}
|
||||
return element.parentNode ? getScrollParent(element.parentNode) : element;
|
||||
return getScrollParent(element.parentNode);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -36,6 +36,35 @@ describe('Alert', () => {
|
||||
.to.equal('Unbowed, Unbent, Unbroken');
|
||||
});
|
||||
|
||||
it('render-content', () => {
|
||||
vm = createVue({
|
||||
data() {
|
||||
return {
|
||||
text: 'test'
|
||||
};
|
||||
},
|
||||
template: `
|
||||
<div>
|
||||
<el-alert
|
||||
title="test"
|
||||
:render-content="customContent"></el-alert>
|
||||
</div>
|
||||
`,
|
||||
methods: {
|
||||
customContent(h) {
|
||||
return (
|
||||
<p>
|
||||
<el-button class="custom-button">{ this.text }</el-button>
|
||||
</p>
|
||||
);
|
||||
}
|
||||
}
|
||||
}, true);
|
||||
let button = vm.$el.querySelector('.custom-button');
|
||||
expect(button).to.exist;
|
||||
expect(button.textContent).to.equal('test');
|
||||
});
|
||||
|
||||
it('close', () => {
|
||||
vm = createVue({
|
||||
template: `
|
||||
|
||||
@@ -116,6 +116,15 @@ describe('Table', () => {
|
||||
}, DELAY);
|
||||
});
|
||||
|
||||
it('show-header', done => {
|
||||
const vm = createTable(':show-header="false"');
|
||||
setTimeout(_ => {
|
||||
expect(vm.$el.querySelectorAll('.el-table__header-wrapper').length).to.equal(0);
|
||||
destroyVM(vm);
|
||||
done();
|
||||
}, DELAY);
|
||||
});
|
||||
|
||||
it('tableRowClassName', done => {
|
||||
const vm = createTable(':row-class-name="tableRowClassName"', {
|
||||
methods: {
|
||||
@@ -384,6 +393,20 @@ describe('Table', () => {
|
||||
}, DELAY);
|
||||
}, DELAY);
|
||||
});
|
||||
|
||||
it('header-click', done => {
|
||||
const vm = createTable('header-click');
|
||||
|
||||
setTimeout(_ => {
|
||||
const cell = vm.$el.querySelectorAll('.el-table__header th')[1]; // header[prop='name']
|
||||
|
||||
triggerEvent(cell, 'click');
|
||||
expect(vm.result).to.length(2); // column, event
|
||||
expect(vm.result[0]).to.have.property('property').to.equal('name');
|
||||
destroyVM(vm);
|
||||
done();
|
||||
}, DELAY);
|
||||
});
|
||||
});
|
||||
|
||||
describe('column attributes', () => {
|
||||
@@ -623,6 +646,48 @@ describe('Table', () => {
|
||||
}, DELAY);
|
||||
});
|
||||
|
||||
it('selectable === false & check selectAll status', done => {
|
||||
const vm = createVue({
|
||||
template: `
|
||||
<el-table :data="testData" @selection-change="change">
|
||||
<el-table-column type="selection" :selectable="filterSelect" />
|
||||
<el-table-column prop="name" label="name" />
|
||||
<el-table-column prop="release" label="release" />
|
||||
<el-table-column prop="director" label="director" />
|
||||
<el-table-column prop="runtime" label="runtime" />
|
||||
</el-table>
|
||||
`,
|
||||
|
||||
created() {
|
||||
},
|
||||
|
||||
data() {
|
||||
return { selected: [], testData: null };
|
||||
},
|
||||
|
||||
methods: {
|
||||
change(rows) {
|
||||
this.selected = rows;
|
||||
},
|
||||
|
||||
filterSelect(row, index) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}, true);
|
||||
|
||||
vm.testData = getTestData();
|
||||
|
||||
setTimeout(_ => {
|
||||
expect(vm.$el.querySelector('.el-checkbox').__vue__.checked).to.be.false;
|
||||
setTimeout(_ => {
|
||||
expect(vm.selected).to.length(0);
|
||||
destroyVM(vm);
|
||||
done();
|
||||
}, DELAY);
|
||||
}, DELAY);
|
||||
});
|
||||
|
||||
it('emit selection-change after row has been removed', done => {
|
||||
const vm = createVue({
|
||||
template: `
|
||||
@@ -920,6 +985,71 @@ describe('Table', () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe('methods', () => {
|
||||
const createTable = function(prop = '', opts) {
|
||||
return createVue({
|
||||
template: `
|
||||
<el-table ref="table" :data="testData" @${prop}="handleEvent">
|
||||
<el-table-column type="selection" />
|
||||
<el-table-column prop="name" />
|
||||
<el-table-column prop="release" />
|
||||
<el-table-column prop="director" />
|
||||
<el-table-column prop="runtime"/>
|
||||
</el-table>
|
||||
`,
|
||||
|
||||
methods: {
|
||||
handleEvent(selection) {
|
||||
this.fireCount++;
|
||||
this.selection = selection;
|
||||
}
|
||||
},
|
||||
|
||||
created() {
|
||||
this.testData = getTestData();
|
||||
},
|
||||
|
||||
data() {
|
||||
return { selection: null, testData: this.testData, fireCount: 0 };
|
||||
}
|
||||
}, true);
|
||||
};
|
||||
|
||||
it('toggleRowSelection', () => {
|
||||
const vm = createTable('selection-change');
|
||||
vm.$refs.table.toggleRowSelection(vm.testData[0]);
|
||||
expect(vm.selection).to.length(1);
|
||||
expect(vm.fireCount).to.equal(1);
|
||||
|
||||
// test use second parameter
|
||||
vm.$refs.table.toggleRowSelection(vm.testData[0], true);
|
||||
expect(vm.fireCount).to.equal(1);
|
||||
|
||||
vm.$refs.table.toggleRowSelection(vm.testData[0], false);
|
||||
expect(vm.fireCount).to.equal(2);
|
||||
expect(vm.selection).to.length(0);
|
||||
|
||||
destroyVM(vm);
|
||||
});
|
||||
|
||||
it('clearSelection', () => {
|
||||
const vm = createTable('selection-change');
|
||||
vm.$refs.table.toggleRowSelection(vm.testData[0]);
|
||||
expect(vm.selection).to.length(1);
|
||||
expect(vm.fireCount).to.equal(1);
|
||||
|
||||
// clear selection
|
||||
vm.$refs.table.clearSelection();
|
||||
expect(vm.fireCount).to.equal(2);
|
||||
expect(vm.selection).to.length(0);
|
||||
|
||||
vm.$refs.table.clearSelection();
|
||||
expect(vm.fireCount).to.equal(2);
|
||||
|
||||
destroyVM(vm);
|
||||
});
|
||||
});
|
||||
|
||||
it('hover', done => {
|
||||
const vm = createVue({
|
||||
template: `
|
||||
|
||||
Reference in New Issue
Block a user