diff --git a/CHANGELOG.fr-FR.md b/CHANGELOG.fr-FR.md index 0636e7195..b0aa00bc7 100644 --- a/CHANGELOG.fr-FR.md +++ b/CHANGELOG.fr-FR.md @@ -870,4 +870,4 @@ - Les paramètres de la méthode `row-class-name` et `row-style` sont maintenant un objet ## -* Rendre du HTML arbitraire de façon dynamique sur votre site Web peut être très dangereux car cela peut facilement mener à[des attaques XSS](https://en.wikipedia.org/wiki/Cross-site_scripting). Donc quand `dangerouslyUseHTMLString' est activé, assurez-vous que le contenu du `message' est fiable, et **ne jamais** assigner `message` au contenu fourni par l'utilisateur.. +* Rendre du HTML arbitraire de façon dynamique sur votre site Web peut être très dangereux car cela peut facilement mener à[des attaques XSS](https://en.wikipedia.org/wiki/Cross-site_scripting). Donc quand `dangerouslyUseHTMLString' est activé, assurez-vous que le contenu du `message' est fiable, et **ne jamais** assigner `message` au contenu fourni par l'utilisateur.. diff --git a/build/md-loader/config.js b/build/md-loader/config.js new file mode 100644 index 000000000..b491c538b --- /dev/null +++ b/build/md-loader/config.js @@ -0,0 +1,26 @@ +const Config = require('markdown-it-chain'); +const anchorPlugin = require('markdown-it-anchor'); +const slugify = require('transliteration').slugify; +const containers = require('./containers'); +const overWriteFenceRule = require('./fence'); + +const config = new Config(); + +config + .options.html(true).end() + + .plugin('anchor').use(anchorPlugin, [ + { + level: 2, + slugify: slugify, + permalink: true, + permalinkBefore: true + } + ]).end() + + .plugin('containers').use(containers).end(); + +const md = config.toMd(); +overWriteFenceRule(md); + +module.exports = md; diff --git a/build/md-loader/containers.js b/build/md-loader/containers.js new file mode 100644 index 000000000..bcdce5be8 --- /dev/null +++ b/build/md-loader/containers.js @@ -0,0 +1,24 @@ +const mdContainer = require('markdown-it-container'); + +module.exports = md => { + md.use(mdContainer, 'demo', { + validate(params) { + return params.trim().match(/^demo\s*(.*)$/); + }, + render(tokens, idx) { + const m = tokens[idx].info.trim().match(/^demo\s*(.*)$/); + if (tokens[idx].nesting === 1) { + const description = m && m.length > 1 ? m[1] : ''; + const content = tokens[idx + 1].type === 'fence' ? tokens[idx + 1].content : ''; + return ` +
${md.render(description)}
+ + `; + } + return '
'; + } + }); + + md.use(mdContainer, 'tip'); + md.use(mdContainer, 'warning'); +}; diff --git a/build/md-loader/fence.js b/build/md-loader/fence.js new file mode 100644 index 000000000..d32862391 --- /dev/null +++ b/build/md-loader/fence.js @@ -0,0 +1,14 @@ +// 覆盖默认的 fence 渲染策略 +module.exports = md => { + const defaultRender = md.renderer.rules.fence; + md.renderer.rules.fence = (tokens, idx, options, env, self) => { + const token = tokens[idx]; + // 判断该 fence 是否在 :::demo 内 + const prevToken = tokens[idx - 1]; + const isInDemoContainer = prevToken && prevToken.nesting === 1 && prevToken.info.trim().match(/^demo\s*(.*)$/); + if (token.info === 'html' && isInDemoContainer) { + return ``; + } + return defaultRender(tokens, idx, options, env, self); + }; +}; diff --git a/build/md-loader/index.js b/build/md-loader/index.js new file mode 100644 index 000000000..610128bca --- /dev/null +++ b/build/md-loader/index.js @@ -0,0 +1,67 @@ +const { + stripScript, + stripTemplate, + genInlineComponentText +} = require('./util'); +const md = require('./config'); + +module.exports = function(source) { + const content = md.render(source); + + const startTag = ''; + const endTagLen = endTag.length; + + let componenetsString = ''; + let id = 0; // demo 的 id + let output = []; // 输出的内容 + let start = 0; // 字符串开始位置 + + let commentStart = content.indexOf(startTag); + let commentEnd = content.indexOf(endTag, commentStart + startTagLen); + while (commentStart !== -1 && commentEnd !== -1) { + output.push(content.slice(start, commentStart)); + + const commentContent = content.slice(commentStart + startTagLen, commentEnd); + const html = stripTemplate(commentContent); + const script = stripScript(commentContent); + let demoComponentContent = genInlineComponentText(html, script); + const demoComponentName = `element-demo${id}`; + output.push(`<${demoComponentName} slot="source" />`); + componenetsString += `${JSON.stringify(demoComponentName)}: ${demoComponentContent},`; + + // 重新计算下一次的位置 + id++; + start = commentEnd + endTagLen; + commentStart = content.indexOf(startTag, start); + commentEnd = content.indexOf(endTag, commentStart + startTagLen); + } + + // 仅允许在 demo 不存在时,才可以在 Markdown 中写 script 标签 + // todo: 优化这段逻辑 + let pageScript = ''; + if (componenetsString) { + pageScript = ``; + } else if (content.indexOf('') + ''.length; + pageScript = content.slice(0, start); + } + + output.push(content.slice(start)); + return ` + + ${pageScript} + `; +}; diff --git a/build/md-loader/util.js b/build/md-loader/util.js new file mode 100644 index 000000000..3c5fe192e --- /dev/null +++ b/build/md-loader/util.js @@ -0,0 +1,79 @@ +const { compileTemplate } = require('@vue/component-compiler-utils'); +const compiler = require('vue-template-compiler'); + +function stripScript(content) { + const result = content.match(/<(script)>([\s\S]+)<\/\1>/); + return result && result[2] ? result[2].trim() : ''; +} + +function stripStyle(content) { + const result = content.match(/<(style)\s*>([\s\S]+)<\/\1>/); + return result && result[2] ? result[2].trim() : ''; +} + +// 编写例子时不一定有 template。所以采取的方案是剔除其他的内容 +function stripTemplate(content) { + content = content.trim(); + if (!content) { + return content; + } + return content.replace(/<(script|style)[\s\S]+<\/\1>/g, '').trim(); +} + +function pad(source) { + return source + .split(/\r?\n/) + .map(line => ` ${line}`) + .join('\n'); +} + +function genInlineComponentText(template, script) { + // https://github.com/vuejs/vue-loader/blob/master/lib/loaders/templateLoader.js#L29 + const finalOptions = { + source: `
${template}
`, + filename: 'inline-component', // TODO:这里有待调整 + compiler + }; + const compiled = compileTemplate(finalOptions); + // tips + if (compiled.tips && compiled.tips.length) { + compiled.tips.forEach(tip => { + console.warn(tip); + }); + } + // errors + if (compiled.errors && compiled.errors.length) { + console.error( + `\n Error compiling template:\n${pad(compiled.source)}\n` + + compiled.errors.map(e => ` - ${e}`).join('\n') + + '\n' + ); + } + let demoComponentContent = ` + ${compiled.code} + `; + // todo: 这里采用了硬编码有待改进 + script = script.trim(); + if (script) { + script = script.replace(/export\s+default/, 'const democomponentExport ='); + } else { + script = 'const democomponentExport = {}'; + } + demoComponentContent = `(function demo() { + ${demoComponentContent} + ${script} + return { + ...democomponentExport, + render, + staticRenderFns + } + })()`; + return demoComponentContent; +} + +module.exports = { + stripScript, + stripStyle, + stripTemplate, + genInlineComponentText +}; diff --git a/build/strip-tags.js b/build/strip-tags.js deleted file mode 100644 index bbb719c19..000000000 --- a/build/strip-tags.js +++ /dev/null @@ -1,34 +0,0 @@ -/*! - * strip-tags - * - * Copyright (c) 2015 Jon Schlinkert, contributors. - * Licensed under the MIT license. - */ - -'use strict'; - -var cheerio = require('cheerio'); - -exports.strip = function(str, tags) { - var $ = cheerio.load(str, {decodeEntities: false}); - - if (!tags || tags.length === 0) { - return str; - } - - tags = !Array.isArray(tags) ? [tags] : tags; - var len = tags.length; - - while (len--) { - $(tags[len]).remove(); - } - - return $.html(); -}; - -exports.fetch = function(str, tag) { - var $ = cheerio.load(str, {decodeEntities: false}); - if (!tag) return str; - - return $(tag).html(); -}; diff --git a/build/webpack.demo.js b/build/webpack.demo.js index 9beccefa5..a853d8b90 100644 --- a/build/webpack.demo.js +++ b/build/webpack.demo.js @@ -7,30 +7,12 @@ const ProgressBarPlugin = require('progress-bar-webpack-plugin'); const VueLoaderPlugin = require('vue-loader/lib/plugin'); const OptimizeCSSAssetsPlugin = require('optimize-css-assets-webpack-plugin'); const UglifyJsPlugin = require('uglifyjs-webpack-plugin'); -const md = require('markdown-it')(); -const slugify = require('transliteration').slugify; -const striptags = require('./strip-tags'); const config = require('./config'); const isProd = process.env.NODE_ENV === 'production'; const isPlay = !!process.env.PLAY_ENV; -function convert(str) { - str = str.replace(/(&#x)(\w{4});/gi, function($0) { - return String.fromCharCode(parseInt(encodeURIComponent($0).replace(/(%26%23x)(\w{4})(%3B)/g, '$2'), 16)); - }); - return str; -} - -function wrap(render) { - return function() { - return render.apply(this, arguments) - .replace('', ''); - }; -} - const webpackConfig = { mode: process.env.NODE_ENV, entry: isProd ? { @@ -93,67 +75,24 @@ const webpackConfig = { }, { test: /\.md$/, - loaders: [ + use: [ { - loader: 'vue-loader' + loader: 'vue-loader', + options: { + compilerOptions: { + preserveWhitespace: false + } + } }, { - loader: 'vue-markdown-loader/lib/markdown-compiler', - options: { - preventExtract: true, - raw: true, - preprocess: function(MarkdownIt, source) { - MarkdownIt.renderer.rules.table_open = function() { - return ''; - }; - MarkdownIt.renderer.rules.fence = wrap(MarkdownIt.renderer.rules.fence); - return source; - }, - use: [ - [require('markdown-it-anchor'), { - level: 2, - slugify: slugify, - permalink: true, - permalinkBefore: true - }], - [require('markdown-it-container'), 'demo', { - validate: function(params) { - return params.trim().match(/^demo\s*(.*)$/); - }, - - render: function(tokens, idx) { - var m = tokens[idx].info.trim().match(/^demo\s*(.*)$/); - if (tokens[idx].nesting === 1) { - var description = (m && m.length > 1) ? m[1] : ''; - var content = tokens[idx + 1].content; - var html = convert(striptags.strip(content, ['script', 'style'])).replace(/(<[^>]*)=""(?=.*>)/g, '$1'); - var script = striptags.fetch(content, 'script'); - var style = striptags.fetch(content, 'style'); - var jsfiddle = { html: html, script: script, style: style }; - var descriptionHTML = description - ? md.render(description) - : ''; - - jsfiddle = md.utils.escapeHtml(JSON.stringify(jsfiddle)); - - return ` -
${html}
- ${descriptionHTML} -
`; - } - return '
\n'; - } - }], - [require('markdown-it-container'), 'tip'], - [require('markdown-it-container'), 'warning'] - ] - } + loader: path.resolve(__dirname, './md-loader/index.js') } ] }, { test: /\.(svg|otf|ttf|woff2?|eot|gif|png|jpe?g)(\?\S*)?$/, loader: 'url-loader', + // todo: 这种写法有待调整 query: { limit: 10000, name: path.posix.join('static', '[name].[hash:7].[ext]') @@ -189,6 +128,11 @@ const webpackConfig = { }; if (isProd) { + webpackConfig.externals = { + vue: 'Vue', + 'vue-router': 'VueRouter', + 'highlight.js': 'hljs' + }; webpackConfig.plugins.push( new MiniCssExtractPlugin({ filename: '[name].[contenthash:7].css' diff --git a/examples/components/demo-block.vue b/examples/components/demo-block.vue index 8381ad407..62d3a6664 100644 --- a/examples/components/demo-block.vue +++ b/examples/components/demo-block.vue @@ -4,12 +4,16 @@ :class="[blockClass, { 'hover': hovering }]" @mouseenter="hovering = true" @mouseleave="hovering = false"> - +
+ +
- +
+ +
import compoLang from '../i18n/component.json'; import Element from 'main/index.js'; + import { stripScript, stripStyle, stripTemplate } from '../util'; const { version } = Element; export default { data() { return { + jsfiddle: { + script: '', + html: '', + style: '' + }, hovering: false, isExpanded: false, fixedControl: false, @@ -191,13 +201,6 @@ }; }, - props: { - jsfiddle: Object, - default() { - return {}; - } - }, - methods: { goJsfiddle() { const { script, html, style } = this.jsfiddle; @@ -299,6 +302,25 @@ } }, + created() { + const highlight = this.$slots.highlight; + if (highlight && highlight[0]) { + let code = ''; + let cur = highlight[0]; + if (cur.tag === 'pre' && (cur.children && cur.children[0])) { + cur = cur.children[0]; + if (cur.tag === 'code') { + code = cur.children[0].text; + } + } + if (code) { + this.jsfiddle.html = stripTemplate(code); + this.jsfiddle.script = stripScript(code); + this.jsfiddle.style = stripStyle(code); + } + } + }, + mounted() { this.$nextTick(() => { let highlight = this.$el.getElementsByClassName('highlight')[0]; diff --git a/examples/components/header.vue b/examples/components/header.vue index 3a3820f88..2452d3e69 100644 --- a/examples/components/header.vue +++ b/examples/components/header.vue @@ -55,9 +55,15 @@ height: 100%; line-height: 80px; background: transparent; - @utils-clearfix; padding: 0; margin: 0; + &::before, &::after { + display: table; + content: ""; + } + &::after { + clear: both; + } } .nav-gap { diff --git a/examples/demo-styles/alert.scss b/examples/demo-styles/alert.scss new file mode 100644 index 000000000..dae5f062a --- /dev/null +++ b/examples/demo-styles/alert.scss @@ -0,0 +1,7 @@ +.demo-block.demo-alert .el-alert { + margin: 20px 0 0; +} + +.demo-block.demo-alert .el-alert:first-child { + margin: 0; +} diff --git a/examples/demo-styles/badge.scss b/examples/demo-styles/badge.scss new file mode 100644 index 000000000..494dacded --- /dev/null +++ b/examples/demo-styles/badge.scss @@ -0,0 +1,19 @@ +.demo-badge.demo-block .el-dropdown { + vertical-align: middle; +} +.demo-badge.demo-block { + .share-button { + width: 36px; + padding: 10px; + } + + .mark { + margin-top: 8px; + line-height: 1; + float: right; + } + + .item { + margin-right: 40px; + } +} diff --git a/examples/demo-styles/border.scss b/examples/demo-styles/border.scss new file mode 100644 index 000000000..b8a921983 --- /dev/null +++ b/examples/demo-styles/border.scss @@ -0,0 +1,44 @@ +.demo-border .text { + width: 15%; +} +.demo-border .line { + width: 70%; +} +.demo-border .line div { + width: 100%; + height: 0; + border: 1px solid #eee; +} +.demo-border .line .dashed { + border: 2px dashed #eee; +} +.demo-shadow { + height: 100px; + width: 50%; + border: 1px solid #eee; +} +.demo-shadow-text { + line-height: 50px; + color: #666; + font-size: 14px; +} +.demo-radius .title { + color: #666; + font-size: 18px; + margin: 10px 0; +} +.demo-radius .value { + color: #333; + font-size: 16px; + margin: 10px 0; +} +.demo-radius .radius { + height: 60px; + width: 70%; + border: 1px solid #d7dae2; + border-radius: 0; + margin-top: 20px; +} +.demo-radius .radius-30 { + border-radius: 30px; +} diff --git a/examples/demo-styles/button.scss b/examples/demo-styles/button.scss new file mode 100644 index 000000000..bc8b7881a --- /dev/null +++ b/examples/demo-styles/button.scss @@ -0,0 +1,21 @@ +.demo-block.demo-button { + .el-row { + margin-bottom: 20px; + + &:last-child { + margin-bottom: 0; + } + } + .el-button + .el-button { + margin-left: 10px; + } + .el-button-group { + .el-button + .el-button { + margin-left: 0; + } + + & + .el-button-group { + margin-left: 10px; + } + } +} diff --git a/examples/demo-styles/card.scss b/examples/demo-styles/card.scss new file mode 100644 index 000000000..a558b1496 --- /dev/null +++ b/examples/demo-styles/card.scss @@ -0,0 +1,33 @@ +.demo-block.demo-card { + .text { + font-size: 14px; + } + + .time { + font-size: 13px; + color: #999; + } + + .bottom { + margin-top: 13px; + line-height: 12px; + } + + .item { + margin-bottom: 18px; + } + + .button { + padding: 0; + float: right; + } + + .image { + width: 100%; + display: block; + } + + .box-card { + width: 480px; + } +} diff --git a/examples/demo-styles/carousel.scss b/examples/demo-styles/carousel.scss new file mode 100644 index 000000000..02f137f04 --- /dev/null +++ b/examples/demo-styles/carousel.scss @@ -0,0 +1,47 @@ +.demo-carousel .block { + padding: 30px; + text-align: center; + border-right: solid 1px #eff2f6; + display: inline-block; + width: 50%; + box-sizing: border-box; + &:last-child { + border-right: none; + } +} + +.demo-carousel .demonstration { + display: block; + color: #8492a6; + font-size: 14px; + margin-bottom: 20px; +} + +.demo-carousel .el-carousel__container { + text-align: center; +} + +.demo-carousel .el-carousel__item { + h3 { + color: #fff; + font-size: 18px; + line-height: 300px; + margin: 0; + } + &:nth-child(2n) { + background-color: #99a9bf; + } + &:nth-child(2n + 1) { + background-color: #d3dce6; + } +} + +.demo-carousel .small h3 { + font-size: 14px; + line-height: 150px; +} + +.demo-carousel .medium h3 { + font-size: 14px; + line-height: 200px; +} diff --git a/examples/demo-styles/cascader.scss b/examples/demo-styles/cascader.scss new file mode 100644 index 000000000..48d2e7c49 --- /dev/null +++ b/examples/demo-styles/cascader.scss @@ -0,0 +1,28 @@ +.demo-cascader { + .el-cascader { + width: 222px; + } +} +.demo-cascader-size { + .el-cascader { + vertical-align: top; + margin-right: 15px; + } +} +.demo-cascader .block { + padding: 30px 0; + text-align: center; + border-right: solid 1px #eff2f6; + display: inline-block; + width: 50%; + box-sizing: border-box; + &:last-child { + border-right: none; + } +} +.demo-cascader .demonstration { + display: block; + color: #8492a6; + font-size: 14px; + margin-bottom: 20px; +} diff --git a/examples/demo-styles/collapse.scss b/examples/demo-styles/collapse.scss new file mode 100644 index 000000000..11c0d36f6 --- /dev/null +++ b/examples/demo-styles/collapse.scss @@ -0,0 +1,7 @@ +.demo-collapse { + .el-collapse-item__header { + .header-icon { + margin-left: 5px; + } + } +} diff --git a/examples/demo-styles/color-picker.scss b/examples/demo-styles/color-picker.scss new file mode 100644 index 000000000..621cc8acc --- /dev/null +++ b/examples/demo-styles/color-picker.scss @@ -0,0 +1,20 @@ +.demo-color-picker .block { + padding: 30px 0; + text-align: center; + border-right: solid 1px #eff2f6; + display: inline-block; + width: 50%; + box-sizing: border-box; + &:last-child { + border-right: none; + } +} +.demo-color-picker .demonstration { + display: block; + color: #8492a6; + font-size: 14px; + margin-bottom: 20px; +} +.demo-color-picker .el-color-picker + .el-color-picker { + margin-left: 20px; +} diff --git a/examples/demo-styles/color.scss b/examples/demo-styles/color.scss new file mode 100644 index 000000000..c8a145700 --- /dev/null +++ b/examples/demo-styles/color.scss @@ -0,0 +1,72 @@ +.demo-color-box { + position: relative; + border-radius: 4px; + padding: 20px; + margin: 5px 0; + height: 114px; + box-sizing: border-box; + color: #fff; + font-size: 14px; + + & .value { + font-size: 12px; + opacity: 0.69; + line-height: 24px; + } +} +.demo-color-box-other { + height: 74px; + margin: 10px 0 !important; + border-radius: 4px 4px 4px 4px !important; + padding: 15px 20px; +} +.demo-color-box-group { + .demo-color-box { + border-radius: 0; + margin: 0; + } + .demo-color-box:first-child { + border-radius: 4px 4px 0 0; + } + .demo-color-box:last-child { + border-radius: 0 0 4px 4px; + } +} +.bg-color-sub { + width: 100%; + height: 40px; + left: 0; + bottom: 0; + position: absolute; + border-radius: 0 0 4px 4px; +} +.bg-blue-sub-item { + width: 11.1111111%; + height: 100%; + display: inline-block; +} +.bg-blue-sub-item:first-child { + border-radius: 0 0 0 4px; +} +.bg-success-sub-item { + width: 50%; + height: 100%; + display: inline-block; +} +.bg-success-sub-item:first-child { + border-radius: 0 0 0 4px; +} +.bg-success-sub-item:last-child { + border-radius: 0 0 4px 0; +} +.bg-transparent { + border: 1px solid #fcc3c3; + color: #303133; + background: url("data:image/svg+xml;utf8,"); + background-repeat: no-repeat; + background-position: center center; + background-size: 100% 100%, auto; +} +.demo-color-box-lite { + color: #303133; +} diff --git a/examples/demo-styles/container.scss b/examples/demo-styles/container.scss new file mode 100644 index 000000000..f97fc74e9 --- /dev/null +++ b/examples/demo-styles/container.scss @@ -0,0 +1,43 @@ +.el-header, +.el-footer { + background-color: #b3c0d1; + color: #333; + line-height: 60px; +} + +.el-aside { + color: #333; +} + +#chang-jian-ye-mian-bu-ju + .demo-container { + .el-header, + .el-footer { + text-align: center; + } + + .el-aside { + background-color: #d3dce6; + text-align: center; + line-height: 200px; + } + + .el-main { + background-color: #e9eef3; + color: #333; + text-align: center; + line-height: 160px; + } + + & > .source > .el-container { + margin-bottom: 40px; + + &:nth-child(5) .el-aside, + &:nth-child(6) .el-aside { + line-height: 260px; + } + + &:nth-child(7) .el-aside { + line-height: 320px; + } + } +} diff --git a/examples/demo-styles/date-picker.scss b/examples/demo-styles/date-picker.scss new file mode 100644 index 000000000..96bee1a42 --- /dev/null +++ b/examples/demo-styles/date-picker.scss @@ -0,0 +1,36 @@ +.demo-block.demo-date-picker .source > div { + padding: 0; + display: flex; + flex-wrap: wrap; +} + +.demo-date-picker .block { + padding: 30px 0; + text-align: center; + border-right: solid 1px #eff2f6; + flex: 1; + &:last-child { + border-right: none; + } +} + +.demo-date-picker .container { + flex: 1; + border-right: solid 1px #eff2f6; + .block { + border-right: none; + &:last-child { + border-top: solid 1px #eff2f6; + } + } + &:last-child { + border-right: none; + } +} + +.demo-date-picker .demonstration { + display: block; + color: #8492a6; + font-size: 14px; + margin-bottom: 20px; +} diff --git a/examples/demo-styles/datetime-picker.scss b/examples/demo-styles/datetime-picker.scss new file mode 100644 index 000000000..481fe02ff --- /dev/null +++ b/examples/demo-styles/datetime-picker.scss @@ -0,0 +1,21 @@ +.demo-block.demo-datetime-picker .source { + padding: 0; + display: flex; +} + +.demo-datetime-picker .block { + padding: 30px 0; + text-align: center; + border-right: solid 1px #eff2f6; + flex: 1; + &:last-child { + border-right: none; + } +} + +.demo-datetime-picker .demonstration { + display: block; + color: #8492a6; + font-size: 14px; + margin-bottom: 20px; +} diff --git a/examples/demo-styles/dialog.scss b/examples/demo-styles/dialog.scss new file mode 100644 index 000000000..ddf104332 --- /dev/null +++ b/examples/demo-styles/dialog.scss @@ -0,0 +1,20 @@ +.demo-block.demo-dialog { + .dialog-footer button:first-child { + margin-right: 10px; + } + .full-image { + width: 100%; + } + .el-dialog__wrapper { + margin: 0; + } + .el-select { + width: 300px; + } + .el-input { + width: 300px; + } + .el-button--text { + margin-right: 15px; + } +} diff --git a/examples/demo-styles/dropdown.scss b/examples/demo-styles/dropdown.scss new file mode 100644 index 000000000..07c20b6cb --- /dev/null +++ b/examples/demo-styles/dropdown.scss @@ -0,0 +1,37 @@ +.demo-block { + .el-dropdown { + vertical-align: top; + + & + .el-dropdown { + margin-left: 15px; + } + } + .el-dropdown-link { + cursor: pointer; + color: #409eff; + } + .el-icon-arrow-down { + font-size: 12px; + } +} + +.block-col-2 { + margin: -24px; + + .el-col { + padding: 30px 0; + text-align: center; + border-right: 1px solid #eff2f6; + + &:last-child { + border-right: 0; + } + } +} + +.demo-dropdown .demonstration { + display: block; + color: #8492a6; + font-size: 14px; + margin-bottom: 20px; +} diff --git a/examples/demo-styles/form.scss b/examples/demo-styles/form.scss new file mode 100644 index 000000000..365bf62d3 --- /dev/null +++ b/examples/demo-styles/form.scss @@ -0,0 +1,73 @@ +.demo-form.demo-zh-CN { + .el-select .el-input { + width: 380px; + } + .el-form { + width: 460px; + } + + .line { + text-align: center; + } + + .el-checkbox-group { + width: 320px; + margin: 0; + padding: 0; + list-style: none; + + &:after, + &:before { + content: " "; + display: table; + } + &:after { + clear: both; + visibility: hidden; + font-size: 0; + height: 0; + } + + .el-checkbox { + float: left; + width: 160px; + padding-right: 20px; + margin: 0; + padding: 0; + + + .el-checkbox { + margin-left: 0; + } + } + } + .demo-form-normal { + width: 460px; + } + .demo-form-inline { + width: auto; + + .el-input { + width: 150px; + } + > * { + margin-right: 10px; + } + } + .demo-ruleForm { + width: 460px; + + .el-select .el-input { + width: 360px; + } + } + .demo-dynamic { + .el-input { + margin-right: 10px; + width: 270px; + vertical-align: top; + } + } + .fr { + float: right; + } +} diff --git a/examples/demo-styles/i18n.scss b/examples/demo-styles/i18n.scss new file mode 100644 index 000000000..eabe9ce05 --- /dev/null +++ b/examples/demo-styles/i18n.scss @@ -0,0 +1,8 @@ +ul.language-list { + color: #5e6d82; + font-size: 14px; + padding-left: 20px; + li { + line-height: 1.8; + } +} diff --git a/examples/demo-styles/icon.scss b/examples/demo-styles/icon.scss new file mode 100644 index 000000000..283a65616 --- /dev/null +++ b/examples/demo-styles/icon.scss @@ -0,0 +1,69 @@ +.demo-icon .source > div > i { + color: #606266; + margin: 0 20px; + font-size: 1.5em; + vertical-align: middle; +} + +.demo-icon .source button { + margin: 0 20px; +} + +.page-component .content > ul.icon-list { + overflow: hidden; + list-style: none; + padding: 0; + border: solid 1px #eaeefb; + border-radius: 4px; +} +.icon-list li { + float: left; + width: 16.66%; + text-align: center; + height: 120px; + line-height: 120px; + color: #666; + font-size: 13px; + border-right: 1px solid #eee; + border-bottom: 1px solid #eee; + margin-right: -1px; + margin-bottom: -1px; + + &::after { + display: inline-block; + content: ""; + height: 100%; + vertical-align: middle; + } + + span { + display: inline-block; + line-height: normal; + vertical-align: middle; + font-family: "Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB", + "Microsoft YaHei", SimSun, sans-serif; + color: #99a9bf; + transition: color 0.15s linear; + } + + i { + display: block; + font-size: 32px; + margin-bottom: 15px; + color: #606266; + transition: color 0.15s linear; + } + + .icon-name { + display: inline-block; + padding: 0 3px; + height: 1em; + } + + &:hover { + span, + i { + color: rgb(92, 182, 255); + } + } +} diff --git a/examples/demo-styles/index.scss b/examples/demo-styles/index.scss new file mode 100644 index 000000000..95458e83b --- /dev/null +++ b/examples/demo-styles/index.scss @@ -0,0 +1,40 @@ +@import "./alert.scss"; +@import "./badge.scss"; +@import "./border.scss"; +@import "./button.scss"; +@import "./card.scss"; +@import "./carousel.scss"; +@import "./cascader.scss"; +@import "./collapse.scss"; +@import "./color-picker.scss"; +@import "./color.scss"; +@import "./container.scss"; +@import "./date-picker.scss"; +@import "./datetime-picker.scss"; +@import "./dialog.scss"; +@import "./dropdown.scss"; +@import "./form.scss"; +@import "./i18n.scss"; +@import "./icon.scss"; +@import "./input-number.scss"; +@import "./input.scss"; +@import "./layout.scss"; +@import "./loading.scss"; +@import "./menu.scss"; +@import "./pagination.scss"; +@import "./popover.scss"; +@import "./progress.scss"; +@import "./rate.scss"; +@import "./select.scss"; +@import "./slider.scss"; +@import "./switch.scss"; +@import "./table.scss"; +@import "./tag.scss"; +@import "./time-picker.scss"; +@import "./timeline.scss"; +@import "./tooltip.scss"; +@import "./transition.scss"; +@import "./transfer.scss"; +@import "./tree.scss"; +@import "./typography.scss"; +@import "./upload.scss"; diff --git a/examples/demo-styles/input-number.scss b/examples/demo-styles/input-number.scss new file mode 100644 index 000000000..b85cff708 --- /dev/null +++ b/examples/demo-styles/input-number.scss @@ -0,0 +1,5 @@ +.demo-block.demo-input-number { + .el-input-number + .el-input-number { + margin-left: 10px; + } +} diff --git a/examples/demo-styles/input.scss b/examples/demo-styles/input.scss new file mode 100644 index 000000000..affcd4a32 --- /dev/null +++ b/examples/demo-styles/input.scss @@ -0,0 +1,65 @@ +.demo-input.demo-zh-CN { + .el-select .el-input { + width: 130px; + } + .el-input { + width: 180px; + } + .el-textarea { + width: 414px; + } + .el-input-group { + width: 100%; + } + .demo-input-size { + .el-input { + vertical-align: top; + margin: 0 10px 10px 0; + } + } + .input-with-select .el-input-group__prepend { + background-color: #fff; + } + .demo-autocomplete { + text-align: center; + + .sub-title { + margin-bottom: 10px; + font-size: 14px; + color: #8492a6; + } + + .el-col:not(:last-child) { + border-right: 1px solid rgba(224, 230, 237, 0.5); + } + + .el-autocomplete { + text-align: left; + } + } +} +.el-autocomplete-suggestion.my-autocomplete { + li { + line-height: normal; + padding-top: 7px; + padding-bottom: 7px; + + .name { + text-overflow: ellipsis; + overflow: hidden; + } + .addr { + font-size: 12px; + color: #b4b4b4; + } + .highlighted .addr { + color: #ddd; + } + } +} +.demo-input-suffix { + margin-bottom: 15px; + .el-input { + margin-right: 15px; + } +} diff --git a/examples/demo-styles/layout.scss b/examples/demo-styles/layout.scss new file mode 100644 index 000000000..df639344f --- /dev/null +++ b/examples/demo-styles/layout.scss @@ -0,0 +1,28 @@ +.demo-layout { + .el-row { + margin-bottom: 20px; + &:last-child { + margin-bottom: 0; + } + } + .el-col { + border-radius: 4px; + } + .bg-purple-dark { + background: #99a9bf; + } + .bg-purple { + background: #d3dce6; + } + .bg-purple-light { + background: #e5e9f2; + } + .grid-content { + border-radius: 4px; + min-height: 36px; + } + .row-bg { + padding: 10px 0; + background-color: #f9fafc; + } +} diff --git a/examples/demo-styles/loading.scss b/examples/demo-styles/loading.scss new file mode 100644 index 000000000..0fd6e26dc --- /dev/null +++ b/examples/demo-styles/loading.scss @@ -0,0 +1,3 @@ +.demo-loading .el-table { + border: none; +} diff --git a/examples/demo-styles/menu.scss b/examples/demo-styles/menu.scss new file mode 100644 index 000000000..3b350216f --- /dev/null +++ b/examples/demo-styles/menu.scss @@ -0,0 +1,27 @@ +.demo-block.demo-menu { + .el-menu-demo { + padding-left: 55px; + } + .el-menu-vertical-demo:not(.el-menu--collapse) { + width: 240px; + min-height: 400px; + } + .line { + height: 1px; + background-color: #e0e6ed; + margin: 35px -24px; + } + h5 { + font-size: 14px; + color: #8492a6; + margin-top: 10px; + } + .tac { + text-align: center; + + .el-menu-vertical-demo { + display: inline-block; + text-align: left; + } + } +} diff --git a/examples/demo-styles/pagination.scss b/examples/demo-styles/pagination.scss new file mode 100644 index 000000000..09f751d66 --- /dev/null +++ b/examples/demo-styles/pagination.scss @@ -0,0 +1,46 @@ +.demo-pagination .source.first { + padding: 0; +} + +.demo-pagination .first .block { + padding: 30px 0; + text-align: center; + border-right: solid 1px #eff2f6; + display: inline-block; + width: 50%; + box-sizing: border-box; + + &:last-child { + border-right: none; + } +} + +.demo-pagination .first .demonstration { + display: block; + color: #8492a6; + font-size: 14px; + margin-bottom: 20px; +} + +.demo-pagination .source.last { + padding: 0; +} + +.demo-pagination .last .block { + padding: 30px 24px; + border-bottom: solid 1px #eff2f6; + &:last-child { + border-bottom: none; + } +} + +.demo-pagination .last .demonstration { + font-size: 14px; + color: #8492a6; + line-height: 44px; +} + +.demo-pagination .last .demonstration + .el-pagination { + width: 70%; + margin: 5px 20px 0 0; +} diff --git a/examples/demo-styles/popover.scss b/examples/demo-styles/popover.scss new file mode 100644 index 000000000..ee18df753 --- /dev/null +++ b/examples/demo-styles/popover.scss @@ -0,0 +1,11 @@ +.demo-block.demo-popover { + .el-popover + .el-popover { + margin-left: 10px; + } + .el-input { + width: 360px; + } + .el-button { + margin-left: 10px; + } +} diff --git a/examples/demo-styles/progress.scss b/examples/demo-styles/progress.scss new file mode 100644 index 000000000..216c8d8ae --- /dev/null +++ b/examples/demo-styles/progress.scss @@ -0,0 +1,9 @@ +.demo-block.demo-progress { + .el-progress--line { + margin-bottom: 15px; + width: 350px; + } + .el-progress--circle { + margin-right: 15px; + } +} diff --git a/examples/demo-styles/rate.scss b/examples/demo-styles/rate.scss new file mode 100644 index 000000000..938c072f3 --- /dev/null +++ b/examples/demo-styles/rate.scss @@ -0,0 +1,18 @@ +.demo-rate .block { + padding: 30px 0; + text-align: center; + border-right: solid 1px #eff2f6; + display: inline-block; + width: 50%; + box-sizing: border-box; + &:last-child { + border-right: none; + } +} + +.demo-rate .demonstration { + display: block; + color: #8492a6; + font-size: 14px; + margin-bottom: 20px; +} diff --git a/examples/demo-styles/select.scss b/examples/demo-styles/select.scss new file mode 100644 index 000000000..3d3c8e97f --- /dev/null +++ b/examples/demo-styles/select.scss @@ -0,0 +1,3 @@ +.demo-select .el-select { + width: 240px; +} diff --git a/examples/demo-styles/slider.scss b/examples/demo-styles/slider.scss new file mode 100644 index 000000000..1b600a2c7 --- /dev/null +++ b/examples/demo-styles/slider.scss @@ -0,0 +1,24 @@ +.demo-block.demo-slider .source { + padding: 0; +} + +.demo-block.demo-slider .block { + padding: 30px 24px; + overflow: hidden; + border-bottom: solid 1px #eff2f6; + &:last-child { + border-bottom: none; + } +} + +.demo-block.demo-slider .demonstration { + font-size: 14px; + color: #8492a6; + line-height: 44px; +} + +.demo-block.demo-slider .demonstration + .el-slider { + float: right; + width: 70%; + margin-right: 20px; +} diff --git a/examples/demo-styles/switch.scss b/examples/demo-styles/switch.scss new file mode 100644 index 000000000..d62bb6458 --- /dev/null +++ b/examples/demo-styles/switch.scss @@ -0,0 +1,5 @@ +.demo-block.demo-switch { + .el-switch { + margin: 20px 20px 20px 0; + } +} diff --git a/examples/demo-styles/table.scss b/examples/demo-styles/table.scss new file mode 100644 index 000000000..ccd16e6e6 --- /dev/null +++ b/examples/demo-styles/table.scss @@ -0,0 +1,23 @@ +.el-table .warning-row { + background: oldlace; +} + +.el-table .success-row { + background: #f0f9eb; +} + +.demo-table .name-wrapper { + display: inline-block; +} + +.demo-table .demo-table-expand { + label { + width: 90px; + color: #99a9bf; + } + .el-form-item { + margin-right: 0; + margin-bottom: 0; + width: 50%; + } +} diff --git a/examples/demo-styles/tag.scss b/examples/demo-styles/tag.scss new file mode 100644 index 000000000..32225698b --- /dev/null +++ b/examples/demo-styles/tag.scss @@ -0,0 +1,17 @@ +.demo-block.demo-tag { + .el-tag + .el-tag { + margin-left: 10px; + } + .button-new-tag { + margin-left: 10px; + height: 32px; + line-height: 30px; + padding-top: 0; + padding-bottom: 0; + } + .input-new-tag { + width: 90px; + margin-left: 10px; + vertical-align: bottom; + } +} diff --git a/examples/demo-styles/time-picker.scss b/examples/demo-styles/time-picker.scss new file mode 100644 index 000000000..f3c19a6ac --- /dev/null +++ b/examples/demo-styles/time-picker.scss @@ -0,0 +1,5 @@ +.demo-block { + .el-date-editor + .el-date-editor { + margin-left: 10px; + } +} diff --git a/examples/demo-styles/timeline.scss b/examples/demo-styles/timeline.scss new file mode 100644 index 000000000..0a50028f0 --- /dev/null +++ b/examples/demo-styles/timeline.scss @@ -0,0 +1,6 @@ +.demo-timeline .source .radio { + margin-bottom: 20px; +} +.demo-timeline .source .radio .el-radio-group { + margin-left: 20px; +} diff --git a/examples/demo-styles/tooltip.scss b/examples/demo-styles/tooltip.scss new file mode 100644 index 000000000..74e3e238b --- /dev/null +++ b/examples/demo-styles/tooltip.scss @@ -0,0 +1,39 @@ +.demo-tooltip { + .el-tooltip + .el-tooltip { + margin-left: 15px; + } + .box { + width: 400px; + + .top { + text-align: center; + } + + .left { + float: left; + width: 60px; + } + + .right { + float: right; + width: 60px; + } + + .bottom { + clear: both; + text-align: center; + } + + .item { + margin: 4px; + } + + .left .el-tooltip__popper, + .right .el-tooltip__popper { + padding: 8px 10px; + } + .el-tooltip { + margin-left: 0; + } + } +} diff --git a/examples/demo-styles/transfer.scss b/examples/demo-styles/transfer.scss new file mode 100644 index 000000000..a5b49433f --- /dev/null +++ b/examples/demo-styles/transfer.scss @@ -0,0 +1,6 @@ +.demo-transfer { + .transfer-footer { + margin-left: 15px; + padding: 6px 5px; + } +} diff --git a/examples/demo-styles/transition.scss b/examples/demo-styles/transition.scss new file mode 100644 index 000000000..f7828c54d --- /dev/null +++ b/examples/demo-styles/transition.scss @@ -0,0 +1,14 @@ +.demo-transition { + .transition-box { + margin-bottom: 10px; + width: 200px; + height: 100px; + border-radius: 4px; + background-color: #409EFF; + text-align: center; + color: #fff; + padding: 40px 20px; + margin-right: 20px; + box-sizing: border-box; + } +} diff --git a/examples/demo-styles/tree.scss b/examples/demo-styles/tree.scss new file mode 100644 index 000000000..286b0f3bd --- /dev/null +++ b/examples/demo-styles/tree.scss @@ -0,0 +1,48 @@ +.demo-tree { + .leaf { + width: 20px; + background: #ddd; + } + + .folder { + width: 20px; + background: #888; + } + + .buttons { + margin-top: 20px; + } + + .filter-tree { + margin-top: 20px; + } + + .custom-tree-container { + display: flex; + margin: -24px; + } + + .block { + flex: 1; + padding: 8px 24px 24px; + + &:first-child { + border-right: solid 1px #eff2f6; + } + + > p { + text-align: center; + margin: 0; + line-height: 4; + } + } + + .custom-tree-node { + flex: 1; + display: flex; + align-items: center; + justify-content: space-between; + font-size: 14px; + padding-right: 8px; + } +} diff --git a/examples/demo-styles/typography.scss b/examples/demo-styles/typography.scss new file mode 100644 index 000000000..ff9c0a261 --- /dev/null +++ b/examples/demo-styles/typography.scss @@ -0,0 +1,30 @@ +.demo-typo-size { + .color-dark-light { + color: #99a9bf; + } +} +.demo-term-box img { + width: 24%; + margin: 0 4% 20px 0; +} + +.lineH-left { + display: inline-block; + height: 80px; +} +.lineH-right { + display: inline-block; + list-style: none; + padding: 0 0 0 90px; + margin: 0; + vertical-align: top; +} +.lineH-right li { + font-size: 13px; + color: #666; + height: 20px; + line-height: 20px; +} +.lineH-right li span { + padding-left: 40px; +} diff --git a/examples/demo-styles/upload.scss b/examples/demo-styles/upload.scss new file mode 100644 index 000000000..e7f8a941b --- /dev/null +++ b/examples/demo-styles/upload.scss @@ -0,0 +1,39 @@ +.upload-tip { + color: #8492a6; + font-size: 12px; + margin-top: 7px; +} +.demo-block { + margin-bottom: 24px; + + .upload-demo { + width: 360px; + } + .avatar-uploader { + .el-upload { + border: 1px dashed #d9d9d9; + border-radius: 6px; + cursor: pointer; + position: relative; + overflow: hidden; + + &:hover, + &:focus { + border-color: #409eff; + } + } + .avatar-uploader-icon { + font-size: 28px; + color: #8c939d; + width: 178px; + height: 178px; + line-height: 178px; + text-align: center; + } + .avatar { + width: 178px; + height: 178px; + display: block; + } + } +} diff --git a/examples/docs/en-US/alert.md b/examples/docs/en-US/alert.md index 5eb3bdbd9..7cea46f3a 100644 --- a/examples/docs/en-US/alert.md +++ b/examples/docs/en-US/alert.md @@ -1,22 +1,3 @@ - - - ## Alert Displays important alert messages. diff --git a/examples/docs/en-US/badge.md b/examples/docs/en-US/badge.md index 0636dd0ef..9f9a687d7 100644 --- a/examples/docs/en-US/badge.md +++ b/examples/docs/en-US/badge.md @@ -114,27 +114,6 @@ Use a red dot to mark content that needs to be noticed. ``` ::: - - ### Attributes | Attribute | Description | Type | Accepted Values | Default | |------------- |---------------- |---------------- |---------------------- |-------- | diff --git a/examples/docs/en-US/border.md b/examples/docs/en-US/border.md index 406dc047b..aef773ad4 100644 --- a/examples/docs/en-US/border.md +++ b/examples/docs/en-US/border.md @@ -52,53 +52,6 @@ } - - ## Border We standardize the borders that can be used in buttons, cards, pop-ups and other components. diff --git a/examples/docs/en-US/button.md b/examples/docs/en-US/button.md index 6bad26ba8..9c00fff0e 100644 --- a/examples/docs/en-US/button.md +++ b/examples/docs/en-US/button.md @@ -1,27 +1,3 @@ - - ## Button Commonly used button. diff --git a/examples/docs/en-US/card.md b/examples/docs/en-US/card.md index d657fc85e..55c940a49 100644 --- a/examples/docs/en-US/card.md +++ b/examples/docs/en-US/card.md @@ -1,51 +1,3 @@ - - - ## Card Integrate information in a card container. diff --git a/examples/docs/en-US/carousel.md b/examples/docs/en-US/carousel.md index 8d3919451..e2b5f68b1 100644 --- a/examples/docs/en-US/carousel.md +++ b/examples/docs/en-US/carousel.md @@ -1,64 +1,3 @@ - - ## Carousel Loop a series of images or texts in a limited space diff --git a/examples/docs/en-US/cascader.md b/examples/docs/en-US/cascader.md index 6eafc6dce..6387acd24 100644 --- a/examples/docs/en-US/cascader.md +++ b/examples/docs/en-US/cascader.md @@ -1,283 +1,3 @@ - - - - ## Cascader If the options have a clear hierarchical structure, Cascader can be used to view and select them. diff --git a/examples/docs/en-US/checkbox.md b/examples/docs/en-US/checkbox.md index 215c76146..35f9eddc3 100644 --- a/examples/docs/en-US/checkbox.md +++ b/examples/docs/en-US/checkbox.md @@ -1,48 +1,3 @@ - - ## Checkbox A group of options for multiple choices. diff --git a/examples/docs/en-US/collapse.md b/examples/docs/en-US/collapse.md index 9a7bcab06..ed206d120 100644 --- a/examples/docs/en-US/collapse.md +++ b/examples/docs/en-US/collapse.md @@ -1,29 +1,3 @@ - - - - ## Collapse Use Collapse to store contents. diff --git a/examples/docs/en-US/color-picker.md b/examples/docs/en-US/color-picker.md index 0db28de4f..6ebf3e3ec 100644 --- a/examples/docs/en-US/color-picker.md +++ b/examples/docs/en-US/color-picker.md @@ -1,62 +1,3 @@ - - - - ## ColorPicker ColorPicker is a color selector supporting multiple color formats. diff --git a/examples/docs/en-US/color.md b/examples/docs/en-US/color.md index 85ade5e03..a9d2deae7 100644 --- a/examples/docs/en-US/color.md +++ b/examples/docs/en-US/color.md @@ -89,81 +89,6 @@ } - - ## Color Element uses a specific set of palettes to specify colors to provide a consistent look and feel for the products you build. @@ -191,6 +116,7 @@ The main color of Element is bright and friendly blue. >
+ @@ -318,6 +244,7 @@ Neutral colors are for text, background and border colors. You can use different :style="{ background: white, color: '#303133', border: '1px solid #eee' }" >Basic White
{{white}}
Transparent
Transparent
+
diff --git a/examples/docs/en-US/container.md b/examples/docs/en-US/container.md index e1a5e4e07..1fd23b489 100644 --- a/examples/docs/en-US/container.md +++ b/examples/docs/en-US/container.md @@ -1,62 +1,3 @@ - - - - ## Container Container components for scaffolding basic structure of the page: diff --git a/examples/docs/en-US/date-picker.md b/examples/docs/en-US/date-picker.md index e89174670..707f9971f 100644 --- a/examples/docs/en-US/date-picker.md +++ b/examples/docs/en-US/date-picker.md @@ -1,116 +1,3 @@ - - - - ## DatePicker Use Date Picker for date input. diff --git a/examples/docs/en-US/datetime-picker.md b/examples/docs/en-US/datetime-picker.md index 5f44cd21f..728fe4697 100644 --- a/examples/docs/en-US/datetime-picker.md +++ b/examples/docs/en-US/datetime-picker.md @@ -1,92 +1,3 @@ - - - - ## DateTimePicker Select date and time in one picker. diff --git a/examples/docs/en-US/dialog.md b/examples/docs/en-US/dialog.md index 3f60fd8e3..ee01418ed 100644 --- a/examples/docs/en-US/dialog.md +++ b/examples/docs/en-US/dialog.md @@ -1,78 +1,3 @@ - - - - ## Dialog Informs users while preserving the current page state. diff --git a/examples/docs/en-US/dropdown.md b/examples/docs/en-US/dropdown.md index 1f593d709..39f0695be 100644 --- a/examples/docs/en-US/dropdown.md +++ b/examples/docs/en-US/dropdown.md @@ -1,55 +1,3 @@ - - - ## Dropdown Toggleable menu for displaying lists of links and actions. diff --git a/examples/docs/en-US/form.md b/examples/docs/en-US/form.md index 5c653211a..1b9ad7aa6 100644 --- a/examples/docs/en-US/form.md +++ b/examples/docs/en-US/form.md @@ -1,250 +1,3 @@ - - - - ## Form Form consists of `input`, `radio`, `select`, `checkbox` and so on. With form, you can collect, verify and submit data. diff --git a/examples/docs/en-US/icon.md b/examples/docs/en-US/icon.md index a4898fb0c..9a9648181 100644 --- a/examples/docs/en-US/icon.md +++ b/examples/docs/en-US/icon.md @@ -1,75 +1,3 @@ - - - - ## Icon Element provides a set of common icons. @@ -92,7 +20,7 @@ Just assign the class name to `el-icon-iconName`. ### Icons
    -
  • +
  • {{'el-icon-' + name}} diff --git a/examples/docs/en-US/input-number.md b/examples/docs/en-US/input-number.md index e7f277cd7..cf182edda 100644 --- a/examples/docs/en-US/input-number.md +++ b/examples/docs/en-US/input-number.md @@ -1,34 +1,3 @@ - - - - ## InputNumber Input numerical values with a customizable range. diff --git a/examples/docs/en-US/input.md b/examples/docs/en-US/input.md index 6e4484991..5e7f0531b 100644 --- a/examples/docs/en-US/input.md +++ b/examples/docs/en-US/input.md @@ -1,150 +1,3 @@ - - - - ## Input Input data using mouse or keyboard. diff --git a/examples/docs/en-US/layout.md b/examples/docs/en-US/layout.md index fa6bf95e8..ac516e8bc 100644 --- a/examples/docs/en-US/layout.md +++ b/examples/docs/en-US/layout.md @@ -1,34 +1,3 @@ - - ## Layout Quickly and easily create layouts with the basic 24-column. diff --git a/examples/docs/en-US/loading.md b/examples/docs/en-US/loading.md index c355a7bb3..a305498a1 100644 --- a/examples/docs/en-US/loading.md +++ b/examples/docs/en-US/loading.md @@ -1,54 +1,3 @@ - - - - ## Loading Show animation while loading data. diff --git a/examples/docs/en-US/menu.md b/examples/docs/en-US/menu.md index 5bae6c194..802e8d96d 100644 --- a/examples/docs/en-US/menu.md +++ b/examples/docs/en-US/menu.md @@ -1,56 +1,3 @@ - - - - ## NavMenu Menu that provides navigation for your website. diff --git a/examples/docs/en-US/message-box.md b/examples/docs/en-US/message-box.md index c0d183df9..2616e3507 100644 --- a/examples/docs/en-US/message-box.md +++ b/examples/docs/en-US/message-box.md @@ -1,148 +1,3 @@ - - ## MessageBox A set of modal boxes simulating system message box, mainly for alerting information, confirm operations and prompting messages. diff --git a/examples/docs/en-US/message.md b/examples/docs/en-US/message.md index aee106f95..976c38f76 100644 --- a/examples/docs/en-US/message.md +++ b/examples/docs/en-US/message.md @@ -1,86 +1,3 @@ - - ## Message Used to show feedback after an activity. The difference with Notification is that the latter is often used to show a system level passive notification. diff --git a/examples/docs/en-US/notification.md b/examples/docs/en-US/notification.md index dc8116197..1c1eceb03 100644 --- a/examples/docs/en-US/notification.md +++ b/examples/docs/en-US/notification.md @@ -1,115 +1,3 @@ - - ## Notification Displays a global notification message at a corner of the page. diff --git a/examples/docs/en-US/pagination.md b/examples/docs/en-US/pagination.md index 777da3f51..e6ea0796a 100644 --- a/examples/docs/en-US/pagination.md +++ b/examples/docs/en-US/pagination.md @@ -1,52 +1,3 @@ - - ## Pagination If you have too much data to display in one page, use pagination. @@ -188,36 +139,6 @@ Add more modules based on your scenario. ``` ::: - ### Attributes | Attribute | Description | Type | Accepted Values | Default | diff --git a/examples/docs/en-US/popover.md b/examples/docs/en-US/popover.md index ec3622dec..40c747a4f 100644 --- a/examples/docs/en-US/popover.md +++ b/examples/docs/en-US/popover.md @@ -1,100 +1,3 @@ - - - - ## Popover ### Basic usage diff --git a/examples/docs/en-US/progress.md b/examples/docs/en-US/progress.md index c8c24a0f8..3f686c1a3 100644 --- a/examples/docs/en-US/progress.md +++ b/examples/docs/en-US/progress.md @@ -1,14 +1,3 @@ - ## Progress Progress is used to show the progress of current operation, and inform the user the current status. diff --git a/examples/docs/en-US/radio.md b/examples/docs/en-US/radio.md index dfbf16d47..e1192bf90 100644 --- a/examples/docs/en-US/radio.md +++ b/examples/docs/en-US/radio.md @@ -1,23 +1,3 @@ - - ## Radio Single selection among multiple options. diff --git a/examples/docs/en-US/rate.md b/examples/docs/en-US/rate.md index 14997b22e..6cc77c236 100644 --- a/examples/docs/en-US/rate.md +++ b/examples/docs/en-US/rate.md @@ -1,44 +1,3 @@ - - - - ## Rate Used for rating diff --git a/examples/docs/en-US/select.md b/examples/docs/en-US/select.md index 8d574cb20..1e62fec9b 100644 --- a/examples/docs/en-US/select.md +++ b/examples/docs/en-US/select.md @@ -1,138 +1,3 @@ - - - - ## Select When there are plenty of options, use a drop-down menu to display and select desired ones. diff --git a/examples/docs/en-US/slider.md b/examples/docs/en-US/slider.md index 6b7206581..9ff299e6e 100644 --- a/examples/docs/en-US/slider.md +++ b/examples/docs/en-US/slider.md @@ -1,54 +1,3 @@ - - - - ## Slider Drag the slider within a fixed range. diff --git a/examples/docs/en-US/steps.md b/examples/docs/en-US/steps.md index a40404e52..34a03f18a 100644 --- a/examples/docs/en-US/steps.md +++ b/examples/docs/en-US/steps.md @@ -1,19 +1,3 @@ - - ## Steps Guide the user to complete tasks in accordance with the process. Its steps can be set according to the actual application scenario and the number of the steps can't be less than 2. diff --git a/examples/docs/en-US/switch.md b/examples/docs/en-US/switch.md index d8b8bdbcc..f4c30b112 100644 --- a/examples/docs/en-US/switch.md +++ b/examples/docs/en-US/switch.md @@ -1,27 +1,3 @@ - - - - ## Switch Switch is used for switching between two opposing states. diff --git a/examples/docs/en-US/table.md b/examples/docs/en-US/table.md index 658dd762a..5479fa0ea 100644 --- a/examples/docs/en-US/table.md +++ b/examples/docs/en-US/table.md @@ -1,372 +1,3 @@ - - - - ## Table Display multiple data with similar format. You can sort, filter, compare your data in a table. @@ -1977,7 +1608,7 @@ Configuring rowspan and colspan allows you to merge cells ### Custom index You can customize row index in `type=index` columns. -:::demo To customize row indices, use `index` attribute on with `type=index`. If it is assigned to a number, all indices will have an offset of that number. It also accepts a method with each index (starting from `0`) as parameter, and the returned value will be displayed as index. +:::demo To customize row indices, use `index` attribute on `el-table-column` with `type=index`. If it is assigned to a number, all indices will have an offset of that number. It also accepts a method with each index (starting from `0`) as parameter, and the returned value will be displayed as index. ```html