Refactor
parent
3442acade4
commit
29856c6a3a
|
@ -446,10 +446,10 @@ export default {
|
||||||
*/
|
*/
|
||||||
},
|
},
|
||||||
ptm(key = '', params = {}) {
|
ptm(key = '', params = {}) {
|
||||||
return this._getPTValue(this.pt, key, { props: this.$props, state: this.$data, ...params });
|
return this._getPTValue(this.pt, key, { instance: this, props: this.$props, state: this.$data, ...params });
|
||||||
},
|
},
|
||||||
ptmo(obj = {}, key = '', params = {}) {
|
ptmo(obj = {}, key = '', params = {}) {
|
||||||
return this._getPTValue(obj, key, params, false);
|
return this._getPTValue(obj, key, { instance: this, ...params }, false);
|
||||||
},
|
},
|
||||||
cx(key = '', params = {}) {
|
cx(key = '', params = {}) {
|
||||||
return !this.isUnstyled ? this._getOptionValue(this.$css.classes, key, { instance: this, props: this.$props, state: this.$data, parentInstance: this.$parentInstance, ...params }) : undefined;
|
return !this.isUnstyled ? this._getOptionValue(this.$css.classes, key, { instance: this, props: this.$props, state: this.$data, parentInstance: this.$parentInstance, ...params }) : undefined;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<input :class="cx('root')" :value="modelValue" @input="onInput" v-bind="ptm('root')" data-pc-name="inputtext" />
|
<input :class="cx('root')" :value="modelValue" @input="onInput" v-bind="ptm('root', ptmParams)" data-pc-name="inputtext" />
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
@ -17,6 +17,13 @@ export default {
|
||||||
computed: {
|
computed: {
|
||||||
filled() {
|
filled() {
|
||||||
return this.modelValue != null && this.modelValue.toString().length > 0;
|
return this.modelValue != null && this.modelValue.toString().length > 0;
|
||||||
|
},
|
||||||
|
ptmParams() {
|
||||||
|
return {
|
||||||
|
context: {
|
||||||
|
filled: this.filled
|
||||||
|
}
|
||||||
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue