提交 2097e06b 编写于 作者: KK's avatar KK

格式化

上级 995c21fc
......@@ -57,13 +57,6 @@ export default class AppSpan extends Vue {
*/
public queryParam: any;
/**
* 当前选中值
* @memberof AppSpan
*/
public curValue:any = this.value
/**
* 代码表
*
......@@ -77,23 +70,7 @@ export default class AppSpan extends Vue {
* @type {*}
* @memberof AppSpan
*/
public text:any = '';
/**
* vue 生命周期
*
* @memberof AppSpan
*/
public created() {
if (Object.is(this.codeListType, "STATIC")) {
this.items = this.$store.getters.getCodeListItems(this.tag);
this.setText();
} else if(Object.is(this.codeListType, "DYNAMIC")) {
this.load();
}else{
this.setText();
}
}
public text: any = '';
/**
* 是否缓存
......@@ -125,7 +102,7 @@ export default class AppSpan extends Vue {
* @type {*}
* @memberof AppSpan
*/
public currentItem :any = {};
public currentItem: any = {};
/**
......@@ -134,10 +111,10 @@ export default class AppSpan extends Vue {
* @memberof AppSpan
*/
@Watch('value')
public itemChange(){
if(this.tag && Object.is(this.codeListType,"DYNAMIC")){
public itemChange() {
if (this.tag && Object.is(this.codeListType, "DYNAMIC")) {
this.load();
}else{
} else {
this.setText();
}
}
......@@ -147,7 +124,7 @@ export default class AppSpan extends Vue {
*
* @memberof AppSpan
*/
public async load(): Promise<any>{
public async load(): Promise<any> {
if (Object.is(this.codeListType, "STATIC")) {
return;
}
......@@ -173,7 +150,7 @@ export default class AppSpan extends Vue {
* 设置显示值
* @memberof AppSpan
*/
public setText(){
public setText() {
if (!this.value) { // 新建等没有值的情况
this.text = "";
}
......@@ -206,6 +183,21 @@ export default class AppSpan extends Vue {
}
}
/**
* vue 生命周期
*
* @memberof AppSpan
*/
public created() {
if (Object.is(this.codeListType, "STATIC")) {
this.items = this.$store.getters.getCodeListItems(this.tag);
this.setText();
} else if (Object.is(this.codeListType, "DYNAMIC")) {
this.load();
} else {
this.setText();
}
}
}
</script>
<style lang="less">
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册