tag component
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
## 0.0.2 (2017-01-20)
|
||||
|
||||
* 改了bug A
|
||||
* 加了功能B
|
||||
|
||||
## 0.0.1 (2017-01-10)
|
||||
|
||||
* 第一版
|
||||
@@ -0,0 +1,26 @@
|
||||
# @youzan/<%= name %>
|
||||
|
||||
!!! 请在此处填写你的文档最简单描述 !!!
|
||||
|
||||
[![version][version-image]][download-url]
|
||||
[![download][download-image]][download-url]
|
||||
|
||||
[version-image]: http://npm.qima-inc.com/badge/v/@youzan/<%= name %>.svg?style=flat-square
|
||||
[download-image]: http://npm.qima-inc.com/badge/d/@youzan/<%= name %>.svg?style=flat-square
|
||||
[download-url]: http://npm.qima-inc.com/package/@youzan/<%= name %>
|
||||
|
||||
## Demo
|
||||
|
||||
## Usage
|
||||
|
||||
## API
|
||||
|
||||
| 参数 | 说明 | 类型 | 默认值 | 可选值 |
|
||||
|-----------|-----------|-----------|-------------|-------------|
|
||||
| className | 自定义额外类名 | string | '' | '' |
|
||||
|
||||
|
||||
|
||||
|
||||
## License
|
||||
[MIT](https://opensource.org/licenses/MIT)
|
||||
@@ -0,0 +1,3 @@
|
||||
import Tag from './src/main';
|
||||
|
||||
export default Tag;
|
||||
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"name": "<%= name %>",
|
||||
"version": "<%= version %>",
|
||||
"description": "<%= description %>",
|
||||
"main": "./lib/index.js",
|
||||
"author": "<%= author %>",
|
||||
"license": "<%= license %>",
|
||||
"devDependencies": {},
|
||||
"dependencies": {}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
<template>
|
||||
<span class="z-tag" :class="[type ? `z-tag--${type}`: '', { 'is-plain': plain, 'is-mark': mark }]">
|
||||
<slot></slot>
|
||||
</span>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'z-tag',
|
||||
props: {
|
||||
type: String,
|
||||
mark: Boolean,
|
||||
plain: Boolean
|
||||
}
|
||||
};
|
||||
</script>
|
||||
@@ -15,3 +15,4 @@
|
||||
@import './switch.css';
|
||||
@import './panel.css';
|
||||
@import './steps.css';
|
||||
@import './tag.css';
|
||||
|
||||
@@ -0,0 +1,66 @@
|
||||
@import "./common/var.css";
|
||||
@import "./mixins/border_retina.css";
|
||||
|
||||
@component-namespace z {
|
||||
@b tag {
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
line-height: 14px;
|
||||
padding: 1px 5px;
|
||||
border-radius: 2px;
|
||||
font-size: 10px;
|
||||
background: $c-gray;
|
||||
color: $c-white;
|
||||
|
||||
&::after {
|
||||
@mixin border-retina (top, right, bottom, left), $c-gray;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
@m success {
|
||||
background: $c-green;
|
||||
|
||||
&::after {
|
||||
border-color: $c-green;
|
||||
}
|
||||
@when plain {
|
||||
color: $c-green;
|
||||
}
|
||||
}
|
||||
|
||||
@m danger {
|
||||
background: $button-danger-background-color;
|
||||
|
||||
&::after {
|
||||
border-color: $button-danger-background-color;
|
||||
}
|
||||
@when plain {
|
||||
color: $button-danger-background-color;
|
||||
}
|
||||
}
|
||||
|
||||
@m primary {
|
||||
background: $c-blue;
|
||||
|
||||
&::after {
|
||||
border-color: $c-blue;
|
||||
}
|
||||
@when plain {
|
||||
color: $c-blue;
|
||||
}
|
||||
}
|
||||
|
||||
@when plain {
|
||||
background: $c-white;
|
||||
color: $c-gray;
|
||||
}
|
||||
|
||||
@when mark {
|
||||
border-radius: 0 8px 8px 0;
|
||||
|
||||
&::after {
|
||||
border-radius: 0 16px 16px 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user