Browse Source

增加input、textarea、radio、formBtns、devicePreview、prompText组件

master
zq 1 week ago
parent
commit
2edd2092da
  1. 35
      examples/package-lock.json
  2. 834
      examples/src/App.vue
  3. 12
      examples/vue.config.js
  4. 7
      packages/DevicePreview/index.js
  5. 120
      packages/DevicePreview/src/index.vue
  6. 7
      packages/GroupFormBtns/index.js
  7. 38
      packages/GroupFormBtns/src/index.vue
  8. 8
      packages/GuipButton/index.js
  9. 7
      packages/GuipInput/index.js
  10. 150
      packages/GuipInput/src/index.vue
  11. 7
      packages/GuipRadio/index.js
  12. 157
      packages/GuipRadio/src/index.vue
  13. 7
      packages/GuipTextarea/index.js
  14. 90
      packages/GuipTextarea/src/index.vue
  15. 7
      packages/PromptText/index.js
  16. 101
      packages/PromptText/src/index.vue
  17. 1
      packages/assets/form_linkActive.svg
  18. 1
      packages/assets/prompt-icon-1.svg
  19. 1
      packages/assets/prompt-icon-2.svg
  20. 1
      packages/assets/prompt-icon-3.svg
  21. 26
      packages/index.js
  22. 1
      packages/styles/common.scss

35
examples/package-lock.json

@ -10,7 +10,7 @@
"dependencies": {
"core-js": "^3.8.3",
"element-ui": "^2.15.13",
"my-vue2-components": "file:../",
"my-components": "file:../",
"vue": "^2.6.14",
"vue-loader": "^17.4.2"
},
@ -28,18 +28,33 @@
}
},
"..": {
"name": "my-components",
"version": "1.0.0",
"name": "@zhicheng1012/zhicheng-components",
"version": "1.0.1",
"license": "MIT",
"dependencies": {
"vue": "^2.6.14"
},
"devDependencies": {
"css-loader": "^5.2.7",
"babel-eslint": "~10.1.0",
"css-loader": "~5.2.7",
"eslint": "~6.8.0",
"eslint-plugin-vue": "~6.2.2",
"file-loader": "^6.2.0",
"sass": "^1.89.2",
"sass-loader": "~10.2.0",
"style-loader": "~2.0.0",
"url-loader": "^4.1.1",
"vue": "^2.6.14",
"vue-loader": "^15.9.8",
"vue-svg-loader": "^0.16.0",
"vue-template-compiler": "^2.6.14",
"webpack": "^4.46.0",
"webpack-cli": "^4.9.2"
"webpack": "~4.46.0",
"webpack-cli": "~4.10.0"
},
"engines": {
"node": ">=12.0.0 <=16.x",
"npm": ">=6.0.0"
},
"peerDependencies": {
"element-ui": "^2.15.14",
"vue": "^2.6.14"
}
},
"node_modules/@achrinza/node-ipc": {
@ -11415,7 +11430,7 @@
"dev": true,
"license": "ISC"
},
"node_modules/my-vue2-components": {
"node_modules/my-components": {
"resolved": "..",
"link": true
},

834
examples/src/App.vue

@ -1,55 +1,809 @@
<template>
<div id="app" class="demo-container">
<div id="app" class="demo-container">
<el-form :model="form" :rules="rules" class="el-row demo-ruleForm" ref="formRef">
<!-- 按钮组件示例 -->
<section class="demo-section">
<h2>页面提示框集合</h2>
<PromptText text='这是一个提示框' :type="1" />
<PromptText text='这是一个提示框' :type="2" />
<PromptText text='这是一个提示框' :type="3" />
<PromptText text="前期准备事项" :type="1" class="beforeNotice">
<template #next_desc>
<p class="flex">
<a href="https://e.360.cn/static/zhihui/login/?rdurl=https%3A%2F%2Fe.360.cn%2F" class="flex"
target="_blank">
<img src="~@assets/form_linkActive.svg" alt="">前往登陆</a>登录360智慧平台
</p>
</template>
<template #desc>
<p class="mt12 flex">
1. <a href="https://e.360.cn/static/zhihui/login/?rdurl=https%3A%2F%2Fe.360.cn%2F" class="flex"
target="_blank">
<img src="~@assets/form_linkActive.svg" alt="">前往登陆</a>登录360智慧平台
</p>
<p class="mt10 flex">
2. <a href="https://dianjing.e.360.cn/ocpc/list" class="flex" target="_blank">
<img src="~@assets/form_linkActive.svg" alt="">前往ocpc设置页</a>点击添加OCPC投放包按钮注意转换类型只能选择订单其他的根据表单提示填写
</p>
</template>
</PromptText>
</section>
<section class="demo-section">
<h2>按钮组件集合</h2>
<div class="flex">
<GuipButton type="ignore">哈哈</GuipButton>
<GuipButton size="big">哈哈</GuipButton>
<div class="ele-item">
<label for="">按钮尺寸</label>
<GuipButton size="superBig">加盟并进入后台</GuipButton>
<GuipButton size="big">准备完毕验证自有域名</GuipButton>
<GuipButton size="page">下一步</GuipButton>
<GuipButton size="primary">保存</GuipButton>
<GuipButton size="table">新增站点</GuipButton>
<GuipButton size="form">前往添加</GuipButton>
</div>
<div class="ele-item">
<label for="">强按钮</label>
<!-- 默认 type= primary normal 样式 -->
<GuipButton>默认</GuipButton>
<GuipButton loading>按钮</GuipButton>
<GuipButton disabled>按钮</GuipButton>
</div>
<div class="ele-item">
<label for="">弱按钮</label>
<GuipButton type="ignore">按钮</GuipButton>
<GuipButton type="ignore" loading>按钮</GuipButton>
<GuipButton type="ignore" disabled>按钮</GuipButton>
</div>
<div class="ele-item">
<label for="">中按钮</label>
<GuipButton type="system">按钮</GuipButton>
<GuipButton type="system" loading>按钮</GuipButton>
<GuipButton type="system" disabled>按钮</GuipButton>
</div>
<div class="ele-item">
<label for="">文字按钮</label>
<GuipButton type="text">强引导</GuipButton>
<GuipButton type="grey">弱引导</GuipButton>
</div>
<div class="ele-item">
<label for="">按钮套餐</label>
<GroupFormBtns />
</div>
</section>
<section class="demo-section">
<h2>输入框集合</h2>
<div class="ele-item">
<label for="">输入框</label>
<GuipInput ref="GuipInput" v-model="form.input1" width="200px" height="30px" placeholder="这是自定义默认提示语" />
<div style="width: 20px;height: 10px;"></div>
<GuipInput ref="GuipInput" v-model="form.input2" :maxlength="100" @change="handleInput" @blur="handleInput"
@input="handleInput" @focus="handleInput" placeholder="这是自定义默认提示语" />
<div style="width: 20px;height: 10px;"></div>
<GuipInput v-model="form.input3" width="400px">
<span slot="prependshow">http:</span>
<!-- <img slot="prefix" src="../assets/radio_checked.svg" alt=""> -->
<!-- 输入框后面小图标 -事件自定义 -->
<i slot="suffix" class="el-icon-close" @click="handleClear"></i>
<!-- <img slot="suffix" src="../assets/radio_nochecked.svg" alt="" @click="handleClear"> -->
<!-- 这个 appendshow 宽度 居中方式 自定义添加类名修改-->
<!-- <GuipButton slot="appendshow" size="mini">默认按钮</GuipButton> -->
<!-- 这个 appendshow 宽度 居中方式 自定义添加类名修改-->
<span slot="appendshow">.checkcopy.com</span>
</GuipInput>
<!-- <el-input placeholder="oieuwroieuwi" style="width:400px;height:60px"></el-input> -->
</div>
<div class="ele-item">
<label for="">文本域固定行数</label>
<GuipTextarea :styleObject="{ width: '450px' }" placeholder="固定行数" :rows="1" />
</div>
<div class="ele-item">
<label for="">文本域自适应高度</label>
<GuipTextarea :styleObject="{ width: '450px' }" placeholder="自适应高度" autosize />
</div>
<div class="ele-item">
<label for="">文本域自定义label描述</label>
<GuipTextarea label="详细介绍" column="column" prop="doctor_detail" width="400px" height="40px"
placeholder="请输入描述内容" desc="啊哈哈哈哈哈哈哈哈" show-word-limit />
</div>
</section>
<section class="demo-section">
<h2>实时预览tab组件</h2>
<DevicePreview>
<template #desktop>
电脑端内容-内容自定义
</template>
<template #mobile>
内容自定义
手机端端内容-- 手机端端内容
</template>
</DevicePreview>
</section>
<section>
<h2>单选框组件集合</h2>
<div class="ele-item">
<label for="">单选框(对象格式)</label>
<GuipRadio v-model="form.language" :options="languageOptions" label="选择语言" prop="language"
@change="radioChange" :rules="rules.language" />
</div>
<div class="ele-item">
<label for="">单选框2数组格式 + 自定义取值</label>
<GuipRadio v-model="form.language" :options="languageOptions1" label="自定义属性" prop="language"
@change="radioChange" :rules="rules.language" label-key="name" :disabledKeys="['1']" value-key="id" />
</div>
<div class="ele-item">
<label for="">单选框</label>
<el-radio v-model="radio1" :label="1">选项一</el-radio>
<el-radio v-model="radio1" :label="2">选项二</el-radio>
</div>
<div class="ele-item">
<label for="">单选框组</label>
<el-radio-group v-model="radio" @input="radioChange">
<el-radio :label="3">备选项</el-radio>
<el-radio :label="6">备选项</el-radio>
<el-radio :label="9">备选项</el-radio>
</el-radio-group>
</div>
</section>
</div>
</template>
<script>
export default {
data() {
return {
//
tableData: [
{ id: 1, name: '张三', age: 25 },
{ id: 2, name: '李四', age: 30 }
</el-form>
</div>
</template>
<script>
export default {
data() {
return {
content: '测试一下',
domainOptions: [
{
value: '.chachongz.com',
label: '111.chachongz.com',
id: '11',
name: '测试一下自定义名称111'
},
{
value: '.turnitin.org.cn',
label: '222.turnitin.org.cn',
id: '22',
name: '测试一下自定义名称222'
},
{
value: '.jishu.chachongz.com',
label: '333.jishu.chachongz.com',
id: '33',
name: '测试一下自定义名称333'
},
],
tableData3: [{
id: '12987122',
name: '王小虎',
amount1: '234',
amount2: '3.2',
amount3: 10
}, {
id: '12987123',
name: '王小虎',
amount1: '165',
amount2: '4.43',
amount3: 12
}, {
id: '12987124',
name: '王小虎',
amount1: '324',
amount2: '1.9',
amount3: 9
}, {
id: '12987125',
name: '王小虎',
amount1: '621',
amount2: '2.2',
amount3: 17
}, {
id: '12987126',
name: '王小虎',
amount1: '539',
amount2: '4.1',
amount3: 15
}],
tableWidth: 0,
currentPage: 1, //
pageSize: 5, //
total: 0, //
tableLoading: false,
timer: null,
date1: '',
switchValue: true,
switchValue1: 1,
switchValue2: '0',
dialogVisible1: false,
dialogVisible: false,//
showCancelButton: true, //
showCloseButton: true, //
form: {
username: '',
language: '',
domain_set: '',
domainSuffix: '11',
domainSuffix1: '.chachongz.com',
card: '1',
input1: '跨年的烟火,绽放天空',
input2: '',
input3: '',
},
languageOptions1: [
{ label: 'JavaScript', value: 'js', selectedLabel: 'JavaScripthhhhhhhhhh', id: '1', name: '麻辣烫' },
{ label: 'Python', value: 'py', selectedLabel: 'JavaScripthhhhhhhhhh', id: '10', name: '易烊千玺' },
{ label: 'Java', value: 'java', disabled: true, selectedLabel: 'JavaScripthhhhhhhhhh', id: '11', name: '王源' }, //
{ label: 'Go', value: 'go', selectedLabel: 'JavaScripthhhhhhhhhh', id: '12', name: '王俊凯' },
],
languageOptions: {
'20': '查重站',
'31': 'AI站'
},
rules: {
username: [
{ required: true, message: '请输入用户名', trigger: 'blur' }
],
card: [
{ required: true, message: '请选择有效信息', trigger: 'blur' }
],
language: [
{ required: true, message: '请选择语言', trigger: 'blur' },
],
columns: [
{ prop: 'id', label: 'ID' },
{ prop: 'name', label: '姓名' },
{ prop: 'age', label: '年龄' }
phone: [
{ required: true, message: '请输入手机号', trigger: 'blur' }
],
age: [
{ required: true, message: '请输入年龄', trigger: 'blur' }
]
},
usernameRules: [{ required: true, message: 'Username is required', trigger: 'blur' }],//rules
msg: "测试",
title: "相关附件",
edit: false,
action: true,
header: false,
width: 1920,
height: 1080,
dataList: [
{ name: "张三", age: 19, id: 1 },
{ name: "李四", age: 20, id: 2 },
],
formList: [],
//
fromItem: {
id: "Shanghai",
id1: "选项4",
name: "用户名",
radioId: "2",
checkboxId: ["上海", "北京"],
textareaIner: "textarea",
dateTime: "2023-09-12 00:00:00",
uploadList: [
{
name: "小梨猫.jpg",
size: 160517,
uid: 1695291434025,
url: "https://ts1.cn.mm.bing.net/th?id=OIP-C.Zte3ljd4g6kqrWWyg-8fhAHaEo&w=316&h=197&c=8&rs=1&qlt=90&o=6&dpr=1.5&pid=3.1&rm=2",
},
],
},
//
tableData2: [{
date: '2016-05-03',
name: '王小虎',
address: '上海市普陀区金沙江路 1518 弄',
price: '20',
age: 20,
//
edit_name: '王小虎', edit_address: '上海市普陀区金沙江路 1518 弄'
}, {
date: '2016-05-02',
name: '王小虎11',
address: '上海市普陀区金沙江路 151811 弄',
price: '10',
age: 30,
edit_name: '王小虎11', edit_address: '上海市普陀区金沙江路 151811 弄'
}, {
date: '2016-05-04',
name: '王小虎',
address: '上海市普陀区金沙江路 1518 弄',
price: '200',
}, {
date: '2016-05-01',
name: '王小虎',
address: '上海市普陀区金沙江路 1518 弄'
}, {
date: '2016-05-08',
name: '王小虎',
address: '上海市普陀区金沙江路 1518 弄'
}, {
date: '2016-05-06',
name: '王小虎',
address: '上海市普陀区金沙江路 1518 弄'
}, {
date: '2016-05-07',
name: '王小虎',
address: '上海市普陀区金沙江路 1518 弄'
}],
tableData4: [{
date: '2016-05-03',
name: '王小虎',
address: '上海市普陀区金沙江路 1518 弄',
price: '20',
age: 20,
//
edit_name: '王小虎', edit_address: '上海市普陀区金沙江路 1518 弄'
}, {
date: '2016-05-02',
name: '王小虎11',
address: '上海市普陀区金沙江路 151811 弄',
price: '10',
age: 30,
edit_name: '王小虎11', edit_address: '上海市普陀区金沙江路 151811 弄'
}, {
date: '2016-05-04',
name: '王小虎',
address: '上海市普陀区金沙江路 1518 弄',
price: '200',
}, {
date: '2016-05-01',
name: '王小虎',
address: '上海市普陀区金沙江路 1518 弄'
}, {
date: '2016-05-08',
name: '王小虎',
address: '上海市普陀区金沙江路 1518 弄'
}, {
date: '2016-05-06',
name: '王小虎',
address: '上海市普陀区金沙江路 1518 弄'
}, {
date: '2016-05-07',
name: '王小虎',
address: '上海市普陀区金沙江路 1518 弄'
}],
//
columns: [
{ prop: 'name', label: '姓名(带气泡)', popover: true }, //
{ prop: 'age', label: '年龄', popover: true }, //
{ prop: 'address', label: '地址(带气泡)', popover: true }, //
],
optionss: [
{
value: "选项1",
label: "黄金糕",
},
{
value: "选项2",
label: "双皮奶",
},
{
value: "选项3",
label: "蚵仔煎",
},
{
value: "选项4",
label: "龙须面",
},
{
value: "选项5",
label: "北京烤鸭",
},
],
cities: [
{
value: "Beijing",
label: "北京",
},
{
value: "Shanghai",
label: "上海",
},
{
value: "Nanjing",
label: "南京",
},
{
value: "Chengdu",
label: "成都",
},
{
value: "Shenzhen",
label: "深圳",
},
{
value: "Guangzhou",
label: "广州",
}
],
tableData: [],
input: 'hahhahah',
defaultValue: 'asdasda',
radio: 3,
radio1: 5,
btnstyleObj: {
width: '388px',
height: '46px',
borderRadius: '4px',
background: '#006AFF',
},
btnstyleObj1: {
width: '247px',
height: '46px',
borderRadius: '4px',
},
styleObject: {
minWidth: '200px',
maxWidth: '400px',
// height: '40px'
},
styleObject1: {
width: '600px',
height: '50px'
},
plain: false,
options: [{
value: '选项1',
label1: '黄金hhhhhh',
id1: '1',
id2: '啊11哈哈',
label: '黄金糕'
}, {
value: '选项2',
id1: '12',
id2: '啊22哈哈',
label1: '双皮奶hhhhhhhhh',
label: '双皮奶'
}, {
value: '选项3',
id1: '13',
id2: '啊33哈哈',
label1: '蚵仔煎hhhhhhhhh',
label: '蚵仔煎'
}, {
value: '选项4',
id1: '14',
id2: '啊444哈哈',
label1: '双皮奶hhhhhhhhh',
label: '龙须面'
}, {
value: '选项5',
id1: '155',
id2: '啊55哈哈',
label1: '双皮奶hhhhhhhhh',
label: '北京烤鸭'
}],
}
},
created() {
console.log('当前组件注册情况:', this.$options.components)
},
computed: {
currentDomainItem() {
return this.findItemById('id', 'domainSuffix');
}
},
methods: {
// copy
handleClickCopy() {
this.$copy(this.form.input1, {
successMsg: '内容已复制到剪贴板',
errorMsg: '复制失败,请按Ctrl+C手动复制',
vm: this
});
},
// radio label
formatLabel(option) {
return `${option.name} (ID: ${option.id})`;
},
findItemById(valueKey, key) {
//
return this.domainOptions.find(item => item[valueKey] === this.form[key]);
},
toggleDrop1(e) {
this.$refs.dropDomain1.toggleDropdown(e)
},
toggleDrop(e) {
this.$refs.dropDomain.toggleDropdown(e)
},
changeInputtest(e) {
console.log(e, '---000changeInputtest');
},
changeSelectIp(item) {
//
// this.selectedItem1 = { ...item };
console.log(item, this.form.domainSuffix, this.form.domainSuffix1, '选中的项-值-');
},
arraySpanMethod({ row, column, rowIndex, columnIndex }) {
console.log(row, column);
if (rowIndex % 2 === 0) {
if (columnIndex === 0) {
return [1, 2];
} else if (columnIndex === 1) {
return [0, 0];
}
}
},
objectSpanMethod({ row, column, rowIndex, columnIndex }) {
console.log(row, column);
if (columnIndex === 0) {
if (rowIndex % 2 === 0) {
return {
rowspan: 2,
colspan: 1
};
} else {
return {
rowspan: 0,
colspan: 0
};
}
}
},
created() {
console.log('当前组件注册情况:', this.$options.components)
openMessage(type) {
console.log(type);
//
switch (type) {
case 'success':
this.$Message.success('成功,文案自定义')
break;
case 'error':
this.$Message.error('失败,文案自定义')
break;
case 'info':
this.$Message.info('提示,文案自定义')
break;
}
//
// this.$Message({
// type: 'success',
// title: '',
// message: '',
// duration: 5000,
// showClose: true,
// center: true
// })
},
showTooltip() {
this.$refs.tooltip.show()
},
hideTooltip() {
this.$refs.tooltip.hide()
},
handleSizeChange(val) {
this.pageSize = val
this.getStagePurchase()
},
handleCurrentChange(val) {
this.currentPage = val
this.getStagePurchase()
},
getStagePurchase() {
this.tableLoading = true
const that = this
that.tableData = []
this.$http('POST', '/supernew/ajax_get_stage_purchase', {
type: 0,
cur_page: 1,
page_size: 5,
}, {
headers: {
'AUTH': '3c901fa4a19a7ad9d01238890863d499'
}
}).then(response => {
this.tableLoading = false
this.$nextTick(() => {
that.tableData = response.data.list
// console.log(that.tableData,'---that.tableData');
// that.type2name = response.data.type2name
that.total = response.data.total
})
}).catch(error => {
console.error(error, 'error')
})
},
btnClick() {
},
openLoading() {
this.$store.dispatch('showLoading')
setTimeout(() => {
this.$store.dispatch('hideLoading')
}, 2000)
},
handleFilter(column) {
//
console.log('筛选列:', column);
},
// key
random() {
var randomNumber = Math.random();
return randomNumber
},
onSwitchChange(value) {
console.log('Switch 状态变化:', this.switchValue, value);
},
// ---start
openDialog() {
this.dialogVisible = true;
},
openDialog1() {
this.dialogVisible1 = true;
},
//
handleConfirm() {
this.$message.success('点击了确认按钮');
this.dialogVisible = false;
},
//
handleCancel() {
this.$message.warning('点击了取消按钮');
this.dialogVisible = false;
this.dialogVisible1 = false;
},
//
handleClose() {
this.$message.info('弹框已关闭');
this.dialogVisible = false;
},
dialogVisibleChange(data) {
console.log(data, 'data098908090');
},
// ---end
//
handlePriceClick(row) {
this.currentRow = row;
this.editedPrice = row.price;
this.dialogVisible = true;
},
// -----
//
onConfirm(row, prop) {
console.log('确认修改:', row, prop);
this.$message.success('修改成功');
this.$set(this.tableData4, row)
console.log(this.tableData4, 'this.tableData=====');
},
//
onCancel(row, prop) {
console.log('取消修改:', row, prop);
this.$message.info('已取消');
this.$set(this.tableData, row)
},
// -----
//
radioChange(data) {
console.log(data, 'radio--data');
},
handleClick(row) {
console.log(row);
},
submitForm() {
this.$refs.formRef.validate((valid) => {
console.log(this.form, '======formxinxi');
if (valid) {
alert('提交成功!');
} else {
return false;
}
});
},
//
resetForm() {
this.$refs.form.resetFields();
},
triggerError() {
this.$refs.formRef.validateField('username', (error) => {
if (error) {
console.log('错误信息:', error);
} else {
console.log('无错误');
}
});
},
getFormdata() {
console.log(this.$refs.GuipInput.value);
},
handleInput(value) {
console.log(value, 'value===输入框输入得知');
},
handleClear(value) {
this.form.input3 = '这是我清除后给的文案'
// this.handleInput('')
console.log(value, 'value===qinghcu');
},
getList() {
const dataList = rules();
dataList.forEach((item) => {
if (item.field === "id") {
item.options = this.cities;
}
if (item.field === "id1") {
item.options = this.optionss;
}
});
this.formList = dataList;
},
save() {
this.$refs.VabForm.submitForm("ruleForm");
},
//
cancellation() {
this.$refs.VabForm.resetForm("ruleForm");
},
//
handleSelectionChange(data) {
// data
//
console.log(data, '表格行信息');
},
//
toggleAllSelection() {
// console.log(this.$refs.multipleTable,'this.$refs.multipleTable');
this.$refs.multipleTable.$refs.guiptable.toggleAllSelection();
},
},
beforeDestroy() {
if (this.timer) {
clearTimeout(this.timer)
// loading
this.$store.dispatch('hideContentLoading')
}
}
</script>
}
</script>
<style scoped>
.demo-container {
padding: 20px;
max-width: 800px;
margin: 0 auto;
}
.demo-section {
margin: 30px 0;
padding: 20px;
border: 1px solid #eee;
border-radius: 4px;
}
h2 {
color: #333;
margin-bottom: 15px;
padding-bottom: 10px;
border-bottom: 1px solid #f0f0f0;
<style scoped>
.demo-container {
padding: 20px;
max-width: 90%;
margin: 0 auto;
}
.ele-item {
display: flex;
align-items: center;
justify-content: flex-start;
margin: 20px 0 30px;
label {
font-size: 16px;
font-weight: bold;
width: 100px;
margin-right: 10px;
text-align: left;
}
</style>
}
.demo-section {
margin: 30px 0;
padding: 20px;
border: 1px solid #eee;
border-radius: 4px;
}
h2 {
color: #333;
margin-bottom: 15px;
padding-bottom: 10px;
border-bottom: 1px solid #f0f0f0;
}
</style>

12
examples/vue.config.js

@ -1,3 +1,5 @@
const path = require('path')
module.exports = {
chainWebpack: config => {
config.devServer.watchOptions({
@ -5,5 +7,13 @@ module.exports = {
poll: 1000 // 检查文件变化的频率
})
},
lintOnSave: false
lintOnSave: false,
configureWebpack: {
resolve: {
alias: {
// 别名
'@assets': path.resolve(__dirname, '../packages/assets')
}
}
}
}

7
packages/DevicePreview/index.js

@ -0,0 +1,7 @@
import DevicePreview from './src/index.vue'
DevicePreview.install = function(Vue) {
Vue.component(DevicePreview.name || 'DevicePreview', DevicePreview)
}
export default DevicePreview

120
packages/DevicePreview/src/index.vue

@ -0,0 +1,120 @@
<template>
<div class="preview-container">
<div class="preview_top flex-between">
<b class="preview-title">实时预览</b>
<div class="toggle-container">
<div class="toggle-button" v-if="showPc" :class="{ active: activeView === 'desktop' }"
@click="switchView('desktop')">
电脑端
</div>
<div class="toggle-button" v-if="showMobile" :class="{ active: activeView === 'mobile' }"
@click="switchView('mobile')">
手机端
</div>
</div>
</div>
<div class="content-container">
<!-- 电脑端内容 -->
<div v-show="activeView === 'desktop'" class="desktop-view">
<slot name="desktop"></slot>
</div>
<!-- 手机端内容 -->
<div v-show="activeView === 'mobile'" class="mobile-view">
<slot name="mobile"></slot>
</div>
</div>
</div>
</template>
<script>
export default {
name: 'DevicePreview',
props:{
showMobile:{
type:Boolean,
default:true
},
showPc:{
type:Boolean,
default:true
},
},
data() {
return {
activeView: 'desktop' //
}
},
methods: {
switchView(view) {
this.activeView = view;
}
}
}
</script>
<style scoped>
.preview-container {
max-width: 800px;
min-width: 300px;
margin: 0 auto;
padding: 24px;
border-radius: 4px;
background: #FAFAFA;
}
.preview_top{
margin-bottom: 20px;
}
.preview-title {
text-align: center;
color: #1E2226;
}
.toggle-container {
display: flex;
height: 26px;
justify-content: center;
align-items: center;
padding: 3px 6px;
border-radius: 4px;
background: #F2F3F5;
}
.toggle-button {
padding: 1px 12px;
border-radius: 2px;
box-sizing: border-box;
cursor: pointer;
transition: all 0.3s ease;
}
.toggle-button.active {
color: #006AFF;
background: #FFFFFF;
}
.toggle-button.active:after {
/* content: '';
position: absolute;
bottom: -11px;
left: 0;
width: 100%;
height: 2px;
background-color: #1890ff; */
}
.content-container {
/* min-height: 300px;
padding: 20px;
border: 2px solid #ffd700;
border-radius: 4px;
background-color: #fff; */
}
.desktop-view,
.mobile-view {
width: 100%;
}
</style>

7
packages/GroupFormBtns/index.js

@ -0,0 +1,7 @@
import GroupFormBtns from './src/index.vue'
GroupFormBtns.install = function(Vue) {
Vue.component(GroupFormBtns.name || 'GroupFormBtns', GroupFormBtns)
}
export default GroupFormBtns

38
packages/GroupFormBtns/src/index.vue

@ -0,0 +1,38 @@
<template>
<div class="btns-wrap flex">
<GuipButton type="ignore" @click="cancelClick">取消</GuipButton>
<GuipButton type="primary" @click="confirmClick">保存</GuipButton>
</div>
</template>
<script>
import GuipButton from '../../GuipButton/src/index.vue';
export default {
name: 'GroupFormBtns',
props: [''],
components: {
GuipButton
},
data(){
return{
}
},
methods:{
cancelClick(){
this.$emit('cancel')
},
confirmClick(){
this.$emit('confirm')
}
}
}
</script>
<style scoped lang="scss">
.btns-wrap{
margin-top: 24px;
justify-content: flex-end;
}
</style>

8
packages/GuipButton/index.js

@ -1,7 +1,7 @@
import Button from './src/index.vue'
import GuipButton from './src/index.vue'
Button.install = function(Vue) {
Vue.component(Button.name || 'MyButton', Button)
GuipButton.install = function(Vue) {
Vue.component(GuipButton.name || 'GuipButton', GuipButton)
}
export default Button
export default GuipButton

7
packages/GuipInput/index.js

@ -0,0 +1,7 @@
import GuipInput from './src/index.vue'
GuipInput.install = function(Vue) {
Vue.component(GuipInput.name || 'GuipInput', GuipInput)
}
export default GuipInput

150
packages/GuipInput/src/index.vue

@ -0,0 +1,150 @@
<template>
<el-form-item :style="{ ...styleObject }" :required="required"
:class="[{ 'column': column }, { 'w510': addClass == 'w510' }, { 'w388': addClass == 'w388' }, 'form-item']" :label="label"
:prop="prop" :rules="rules">
<p v-if="desc" class="desc_right">{{ desc }}</p>
<el-input :type="type" v-bind="$attrs" :placeholder="placeholder1" :disabled="disabled" :maxlength="maxlength1"
:style="{ width: width, height: height }" :value="inputValue" :minLength="minLength1" :show-word-limit="showWordLimit"
@input="$emit('input', $event)" @keydown="handleKeydown" @change="$emit('change', $event)"
@blur="$emit('blur', inputValue)" @focus="$emit('focus', inputValue)" >
<!-- 自定义前面小图标 -->
<template v-slot:prepend>
<slot name="prependshow"></slot>
</template>
<template v-slot:prefix>
<slot name="prefix"></slot>
</template>
<!-- 清除小图标 -->
<template v-slot:suffix>
<slot name="suffix"></slot>
</template>
<template v-slot:append>
<slot name="appendshow"></slot>
</template>
<!-- :error="errorMessage" show-message -->
<!-- <i slot="suffix" v-if="empty" class="el-icon-close" @click="handleClear">h</i> -->
<!-- <el-button slot="append" v-if="hasBtn" type="primary" @click="$emit('enter',value)">搜索</el-button> -->
</el-input>
<!-- 单位 -->
<span class="unit" v-if="unit">{{ unit }}</span>
</el-form-item>
</template>
<script>
export default {
name: 'GuipInput',
props: ['value', 'styleObject', 'disabled', 'defaultValue', 'placeholder','required',
'maxlength', 'minLength', 'clear', 'width', 'height', 'showWordLimit',
'label', 'type', 'prop', 'rules', 'column', 'addClass', 'desc', 'unit'],
data() {
return {
inputValue: this.value || this.defaultValue,
maxlength1: '',
minLength1: 0,
style: {
width: '510px',
height: '38px'
},
placeholder1: ''
}
},
watch: { // value prop 便 inputValue
// defaultValue(newVal) {
// console.log(newVal,'newVal');
// this.inputValue = newVal;
// },
value(newVal) {
this.inputValue = newVal;
},
defaultValue(newVal) {
// valuedefaultValue
if (!this.value && newVal !== this.inputValue) {
this.inputValue = newVal;
}
}
},
created() {
//
// if (this.defaultValue != null) {
// this.inputValue = this.defaultValue;
// }
//
if (this.placeholder) {
this.placeholder1 = this.placeholder;
}
//
if (this.maxlength) {
this.maxlength1 = this.maxlength;
}
//
if (this.minLength) {
this.minLength1 = this.minLength;
}
},
mounted() {
this.$nextTick(() => {
let els = document.querySelectorAll('.el-input');
els.forEach(item => {
item.onmouseover = function () {
item.classList.add("hoverclass")
}
item.onmouseout = function () {
item.classList.remove("hoverclass")
}
// item.addEventListener('mouseover',function(){
// console.log('');
// item.classList.add("hoverclass")
// })
// item.addEventListener('mouseoout',function(){
// console.log('');
// item.classList.remove("hoverclass")
// })
// item.addEventListener('mouseoenter',function(){
// console.log('---');
// item.classList.add("hoverclass")
// })
// item.addEventListener('mouseoleave',function(){
// console.log('');
// item.classList.remove("hoverclass")
// })
})
// console.log(el,'====9999');
// if(els&& this.styleObject){
// for(var key in this.styleObject){
// els.style[key] = this.styleObject[key]
// }
// }
})
},
methods: {
// input
// changeInput(event){
// this.$emit('input', event);
// }
// handleClear(){
// console.log('---');
// this.$emit('clear', '')
// }
handleKeydown(e) {
console.log(e);
// if (e.key === '1') {
e.preventDefault(); //
// }
},
}
}
</script>
<style lang="scss" scoped>
.unit {
position: absolute;
right: 12px;
/* 根据需要调整位置 */
top: 50%;
transform: translateY(-50%);
pointer-events: none;
/* 防止单位文本影响输入框的点击事件 */
}
</style>

7
packages/GuipRadio/index.js

@ -0,0 +1,7 @@
import GuipRadio from './src/index.vue'
GuipRadio.install = function(Vue) {
Vue.component(GuipRadio.name || 'GuipRadio', GuipRadio)
}
export default GuipRadio

157
packages/GuipRadio/src/index.vue

@ -0,0 +1,157 @@
<template>
<el-form-item :class="[{ 'column': column }, 'form-item']" :label="label" :prop="prop" :rules="rules"
:required="required">
<el-radio-group v-model="selectedValue" v-bind="$attrs" @change="handleChange">
<el-radio v-for="(optionValue, optionKey) in normalizedOptions" :key="optionKey"
:label="getValue(optionValue)" :disabled="isDisabled(optionValue[valueKey])">
{{ getLabel(optionValue) }}
</el-radio>
</el-radio-group>
</el-form-item>
</template>
<script>
export default {
name: 'GuipRadio',
props: {
//
column: {
type: String,
default: ''
},
required: {
type: Boolean,
default: false
},
// :
// 1. : [{ label: '', value: '', disabled: false }]
// 2. : { key1: 'value1', key2: 'value2' }
// 3.null
// 4.
options: {
// type: [Array, Object],
default: () => null,
validator: (value) => {
// null
return value == null ||
value === '' ||
Array.isArray(value) ||
(typeof value === 'object' && value !== null)
},
required: true,
},
// 使 v-model
value: {
type: [String, Number, Boolean],
default: '',
},
// label
label: {
type: String,
default: '',
},
// prop
prop: {
type: String,
default: '',
},
//
rules: {
type: Array,
default: () => [],
},
labelKey: {
type: String,
default: 'label'
},
// value
valueKey: {
type: String,
default: 'value'
},
// label
formatter: {
type: Function,
default: null
},
// key
disabledKeys: {
type: Array,
default: () => []
}
},
computed: {
//
normalizedOptions() {
// nullundefined
if (this.options == null || !this.options) {
return [];
}
//
if (Array.isArray(this.options)) {
return this.options.length ? this.options : [];
}
//
if (typeof this.options === 'object') {
const keys = Object.keys(this.options);
return keys.length ? keys.map(key => ({
key,
value: this.options[key]
})) : [];
}
//
return [];
}
},
data() {
return {
selectedValue: this.value, //
};
},
watch: {
// value selectedValue
value(newVal) {
this.selectedValue = newVal;
},
},
methods: {
//
handleChange(value) {
this.$emit('input', value); // v-model
this.$emit('change', value); // change
},
getLabel(option) {
if (this.formatter) return this.formatter(option);
//
if (typeof option === 'object' && 'key' in option && 'value' in option) {
return option.value;
}
return option[this.labelKey] || option;
},
getValue(option) {
//
if (typeof option === 'object' && 'key' in option && 'value' in option) {
return option.key;
}
return option[this.valueKey] || option;
},
//
isDisabled(key) {
return this.disabledKeys.includes(key);
}
},
};
</script>
<style scoped>
/* 自定义样式 */
.el-radio-group {
margin: 10px 0;
}
</style>

7
packages/GuipTextarea/index.js

@ -0,0 +1,7 @@
import GuipTextarea from './src/index.vue'
GuipTextarea.install = function(Vue) {
Vue.component(GuipTextarea.name || 'GuipTextarea', GuipTextarea)
}
export default GuipTextarea

90
packages/GuipTextarea/src/index.vue

@ -0,0 +1,90 @@
<template>
<el-form-item :label="label" :prop="prop" :rules="rules" :class="[{ 'column': column }]" :required="required">
<p v-if="desc" class="desc_right">{{ desc }}</p>
<el-input
type="textarea"
v-bind="$attrs"
v-model="innerValue"
:style="{ width: width, height: height }"
:rows="rows"
@input="handleInput"
@change="handleChange"
></el-input>
</el-form-item>
</template>
<script>
export default {
name: 'GuipTextarea',
inheritAttrs: false,
props: {
// v-model
value: {
type: [String, Number],
default: ''
},
// '100px' '100%'
width: {
type: String,
default: '100%'
},
desc: {
type: String,
default: ''
},
// '100px' '100%'
height: {
type: String,
default: 'auto'
},
//
rows: {
type: Number,
default: 4
},
//
label: {
type: String,
default: ''
},
column: {
type: String,
default: ''
},
// prop
prop: {
type: String,
default: ''
},
//
rules: {
type: [Object, Array],
default: () => []
},
required:{
type: Boolean,
default: false
}
},
data() {
return {
innerValue: this.value
}
},
watch: {
value(newVal) {
if (newVal !== this.innerValue) {
this.innerValue = newVal
}
}
},
methods: {
handleInput(value) {
this.$emit('input', value)
},
handleChange(value) {
this.$emit('change', value)
}
}
}
</script>

7
packages/PromptText/index.js

@ -0,0 +1,7 @@
import PromptText from './src/index.vue'
PromptText.install = function(Vue) {
Vue.component(PromptText.name || 'PromptText', PromptText)
}
export default PromptText

101
packages/PromptText/src/index.vue

@ -0,0 +1,101 @@
<template>
<div class="prompt-text" :class="typeClass">
<div class="flex-text">
<div class="flex">
<img class="prompt-icon" :src="typeIcon" alt="">
<span class="prompt-desc">{{ text }}</span>
</div>
<div class="flex">
<slot name="next_desc" />
</div>
</div>
<div class="prompt-extra">
<slot name="desc" />
</div>
</div>
</template>
<script>
export default {
name: 'PromptText',
props: {
text: {
type: String,
required: true
},
type: {
type: [Number, String],
default: 2
},
},
components: {
},
data() {
return {}
},
computed: {
typeClass() {
switch (parseInt(this.type)) {
case 1: return 'info';
case 2: return 'notice';
case 3: return 'warning';
default: return 'notice';
}
},
typeIcon() {
switch (parseInt(this.type)) {
case 1: return require('../../assets/prompt-icon-1.svg');
case 2: return require('../../assets/prompt-icon-2.svg');
case 3: return require('../../assets/prompt-icon-3.svg');
default: return require('../../assets/prompt-icon-2.svg');
}
}
},
methods: {
}
}
</script>
<style scoped lang="scss">
.prompt-text {
padding: 8px 13px;
border-radius: 4px;
}
.flex-text {
display: flex;
align-items: center;
align-self: stretch;
justify-content: space-between;
z-index: 1;
}
.info {
background: #F2F7FF;
border: 1px solid #BFDAFF;
}
.notice {
background: #FEFCE8;
border: 1px solid rgba(255, 140, 0, 0.3);
}
.warning {
background: #FFF1F0;
border: 1px solid #FFA39E;
}
.prompt-icon {
width: 16px;
height: 16px;
;
margin-right: 8px;
}
.prompt-desc {
color: #1E2226;
letter-spacing: 0.08em;
}
.prompt-extra {}
</style>

1
packages/assets/form_linkActive.svg

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 8.1 KiB

1
packages/assets/prompt-icon-1.svg

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="none" version="1.1" width="16" height="16" viewBox="0 0 16 16"><defs><clipPath id="master_svg0_217_60685"><rect x="0" y="0" width="16" height="16" rx="0"/></clipPath></defs><g clip-path="url(#master_svg0_217_60685)"><g><path d="M8,1C9.97933,1.052,11.6278,1.7368329999999998,12.9455,3.0545C14.2632,4.372170000000001,14.948,6.02067,15,8C14.948,9.97933,14.2632,11.6278,12.9455,12.9455C11.6278,14.2632,9.97933,14.948,8,15C6.02067,14.948,4.372170000000001,14.2632,3.0545,12.9455C1.7368329999999998,11.6278,1.052,9.97933,1,8C1.052,6.02067,1.7368329999999998,4.372170000000001,3.0545,3.0545C4.372170000000001,1.7368329999999998,6.02067,1.052,8,1C8,1,8,1,8,1C8,1,8,1,8,1ZM9.047,5.297C9.318,5.297,9.542,5.21633,9.719,5.055C9.896,4.89367,9.9845,4.6775,9.9845,4.406499999999999C9.9845,4.1355,9.896,3.91933,9.719,3.758C9.542,3.59667,9.32067,3.516,9.055,3.516C8.78933,3.516,8.568,3.59667,8.391,3.758C8.214,3.91933,8.125499999999999,4.1355,8.125499999999999,4.406499999999999C8.125499999999999,4.6775,8.214,4.89367,8.391,5.055C8.568,5.21633,8.78683,5.297,9.0475,5.297C9.0475,5.297,9.047,5.297,9.047,5.297C9.047,5.297,9.047,5.297,9.047,5.297ZM9.2345,10.922C9.2345,10.85933,9.23967,10.776,9.25,10.672C9.26033,10.568,9.26033,10.469,9.25,10.375C9.25,10.375,8.422,11.328,8.422,11.328C8.33867,11.4217,8.25267,11.4947,8.164,11.547C8.075330000000001,11.5993,7.99983,11.615,7.9375,11.594C7.84383,11.5523,7.80217,11.4793,7.8125,11.375C7.8125,11.375,9.1875,7.047,9.1875,7.047C9.2395,6.75533,9.19267,6.50533,9.047,6.297C8.90133,6.08867,8.667,5.96367,8.344000000000001,5.922C7.97933,5.93233,7.58083,6.086,7.1485,6.383C6.71617,6.68,6.3385,7.05767,6.0155,7.516C6.0155,7.516,6.0155,7.7505,6.0155,7.7505C6.00517,7.85483,6.00517,7.95383,6.0155,8.0475C6.0155,8.0475,6.8435,7.0945,6.8435,7.0945C6.92683,7.00083,7.01283,6.92783,7.1015,6.8755C7.19017,6.82317,7.2605,6.8075,7.3125,6.8285C7.41683,6.8805,7.45333,6.96383,7.422,7.0785C7.422,7.0785,6.0625,11.391,6.0625,11.391C5.9895,11.6513,6.026,11.8832,6.172,12.0865C6.318,12.2898,6.57317,12.4278,6.9375,12.5005C7.4585,12.4902,7.896,12.3392,8.25,12.0475C8.604,11.7558,8.93217,11.3808,9.2345,10.9225C9.2345,10.9225,9.2345,10.922,9.2345,10.922C9.2345,10.922,9.2345,10.922,9.2345,10.922Z" fill="#006AFF" fill-opacity="1"/></g></g></svg>

After

Width:  |  Height:  |  Size: 2.3 KiB

1
packages/assets/prompt-icon-2.svg

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="none" version="1.1" width="16" height="16" viewBox="0 0 16 16"><defs><clipPath id="master_svg0_354_94660/23_30613"><rect x="0" y="0" width="16" height="16" rx="0"/></clipPath></defs><g clip-path="url(#master_svg0_354_94660/23_30613)"><g><path d="M8,1C9.97933,1.052,11.6278,1.7368329999999998,12.9455,3.0545C14.2632,4.372170000000001,14.948,6.02067,15,8C14.948,9.97933,14.2632,11.6278,12.9455,12.9455C11.6278,14.2632,9.97933,14.948,8,15C6.02067,14.948,4.372170000000001,14.2632,3.0545,12.9455C1.7368329999999998,11.6278,1.052,9.97933,1,8C1.052,6.02067,1.7368329999999998,4.372170000000001,3.0545,3.0545C4.372170000000001,1.7368329999999998,6.02067,1.052,8,1C8,1,8,1,8,1C8,1,8,1,8,1ZM9.047,5.297C9.318,5.297,9.542,5.21633,9.719,5.055C9.896,4.89367,9.9845,4.6775,9.9845,4.406499999999999C9.9845,4.1355,9.896,3.91933,9.719,3.758C9.542,3.59667,9.32067,3.516,9.055,3.516C8.78933,3.516,8.568,3.59667,8.391,3.758C8.214,3.91933,8.125499999999999,4.1355,8.125499999999999,4.406499999999999C8.125499999999999,4.6775,8.214,4.89367,8.391,5.055C8.568,5.21633,8.78683,5.297,9.0475,5.297C9.0475,5.297,9.047,5.297,9.047,5.297C9.047,5.297,9.047,5.297,9.047,5.297ZM9.2345,10.922C9.2345,10.85933,9.23967,10.776,9.25,10.672C9.26033,10.568,9.26033,10.469,9.25,10.375C9.25,10.375,8.422,11.328,8.422,11.328C8.33867,11.4217,8.25267,11.4947,8.164,11.547C8.075330000000001,11.5993,7.99983,11.615,7.9375,11.594C7.84383,11.5523,7.80217,11.4793,7.8125,11.375C7.8125,11.375,9.1875,7.047,9.1875,7.047C9.2395,6.75533,9.19267,6.50533,9.047,6.297C8.90133,6.08867,8.667,5.96367,8.344000000000001,5.922C7.97933,5.93233,7.58083,6.086,7.1485,6.383C6.71617,6.68,6.3385,7.05767,6.0155,7.516C6.0155,7.516,6.0155,7.7505,6.0155,7.7505C6.00517,7.85483,6.00517,7.95383,6.0155,8.0475C6.0155,8.0475,6.8435,7.0945,6.8435,7.0945C6.92683,7.00083,7.01283,6.92783,7.1015,6.8755C7.19017,6.82317,7.2605,6.8075,7.3125,6.8285C7.41683,6.8805,7.45333,6.96383,7.422,7.0785C7.422,7.0785,6.0625,11.391,6.0625,11.391C5.9895,11.6513,6.026,11.8832,6.172,12.0865C6.318,12.2898,6.57317,12.4278,6.9375,12.5005C7.4585,12.4902,7.896,12.3392,8.25,12.0475C8.604,11.7558,8.93217,11.3808,9.2345,10.9225C9.2345,10.9225,9.2345,10.922,9.2345,10.922C9.2345,10.922,9.2345,10.922,9.2345,10.922Z" fill="#FF8C00" fill-opacity="1"/></g></g></svg>

After

Width:  |  Height:  |  Size: 2.3 KiB

1
packages/assets/prompt-icon-3.svg

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" fill="none" version="1.1" width="16" height="16" viewBox="0 0 16 16"><defs><clipPath id="master_svg0_242_77707/23_30613"><rect x="0" y="0" width="16" height="16" rx="0"/></clipPath></defs><g clip-path="url(#master_svg0_242_77707/23_30613)"><g><path d="M8,1C9.97933,1.052,11.6278,1.7368329999999998,12.9455,3.0545C14.2632,4.372170000000001,14.948,6.02067,15,8C14.948,9.97933,14.2632,11.6278,12.9455,12.9455C11.6278,14.2632,9.97933,14.948,8,15C6.02067,14.948,4.372170000000001,14.2632,3.0545,12.9455C1.7368329999999998,11.6278,1.052,9.97933,1,8C1.052,6.02067,1.7368329999999998,4.372170000000001,3.0545,3.0545C4.372170000000001,1.7368329999999998,6.02067,1.052,8,1C8,1,8,1,8,1C8,1,8,1,8,1ZM9.047,5.297C9.318,5.297,9.542,5.21633,9.719,5.055C9.896,4.89367,9.9845,4.6775,9.9845,4.406499999999999C9.9845,4.1355,9.896,3.91933,9.719,3.758C9.542,3.59667,9.32067,3.516,9.055,3.516C8.78933,3.516,8.568,3.59667,8.391,3.758C8.214,3.91933,8.125499999999999,4.1355,8.125499999999999,4.406499999999999C8.125499999999999,4.6775,8.214,4.89367,8.391,5.055C8.568,5.21633,8.78683,5.297,9.0475,5.297C9.0475,5.297,9.047,5.297,9.047,5.297C9.047,5.297,9.047,5.297,9.047,5.297ZM9.2345,10.922C9.2345,10.85933,9.23967,10.776,9.25,10.672C9.26033,10.568,9.26033,10.469,9.25,10.375C9.25,10.375,8.422,11.328,8.422,11.328C8.33867,11.4217,8.25267,11.4947,8.164,11.547C8.075330000000001,11.5993,7.99983,11.615,7.9375,11.594C7.84383,11.5523,7.80217,11.4793,7.8125,11.375C7.8125,11.375,9.1875,7.047,9.1875,7.047C9.2395,6.75533,9.19267,6.50533,9.047,6.297C8.90133,6.08867,8.667,5.96367,8.344000000000001,5.922C7.97933,5.93233,7.58083,6.086,7.1485,6.383C6.71617,6.68,6.3385,7.05767,6.0155,7.516C6.0155,7.516,6.0155,7.7505,6.0155,7.7505C6.00517,7.85483,6.00517,7.95383,6.0155,8.0475C6.0155,8.0475,6.8435,7.0945,6.8435,7.0945C6.92683,7.00083,7.01283,6.92783,7.1015,6.8755C7.19017,6.82317,7.2605,6.8075,7.3125,6.8285C7.41683,6.8805,7.45333,6.96383,7.422,7.0785C7.422,7.0785,6.0625,11.391,6.0625,11.391C5.9895,11.6513,6.026,11.8832,6.172,12.0865C6.318,12.2898,6.57317,12.4278,6.9375,12.5005C7.4585,12.4902,7.896,12.3392,8.25,12.0475C8.604,11.7558,8.93217,11.3808,9.2345,10.9225C9.2345,10.9225,9.2345,10.922,9.2345,10.922C9.2345,10.922,9.2345,10.922,9.2345,10.922Z" fill="#FF4D4F" fill-opacity="1"/></g></g></svg>

After

Width:  |  Height:  |  Size: 2.3 KiB

26
packages/index.js

@ -1,9 +1,23 @@
import GuipButton from './GuipButton'
import GroupFormBtns from './GroupFormBtns'
import GuipInput from './GuipInput'
import PromptText from './PromptText'
import GuipTextarea from './GuipTextarea'
import DevicePreview from './DevicePreview'
import GuipRadio from './GuipRadio'
import './styles/index.css' // 全局引入
import './styles/common.scss' // 全局引入
const components = [GuipButton]
const components = [
GuipButton,
GroupFormBtns,
GuipInput,
PromptText,
GuipTextarea,
DevicePreview,
GuipRadio
]
const install = function(Vue) {
const install = function (Vue) {
components.forEach(component => {
Vue.component(component.name, component)
})
@ -11,5 +25,11 @@ const install = function(Vue) {
export default {
install,
GuipButton
GuipButton,
GroupFormBtns,
GuipInput,
PromptText,
GuipTextarea,
DevicePreview,
GuipRadio
}

1
packages/styles/common.scss

@ -674,7 +674,6 @@ body {
.el-form-item.is-required:not(.is-no-asterisk)>.el-form-item__label::after {
content: url(../assets/require.svg);
display: inline-block;
background-image: url(../assets/require.svg);
color: #ff4d4f;
margin-right: 4px;
margin-left: 4px;

Loading…
Cancel
Save