✨ 新增input-number(数字输入框)、tooltip(文字提示)、修改input组件可接受number类型值
This commit is contained in:
9
src/module/tooltip/index.ts
Normal file
9
src/module/tooltip/index.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import type { App } from 'vue'
|
||||
import Component from './index.vue'
|
||||
import type { IDefineComponent } from '../type/index'
|
||||
|
||||
Component.install = (app: App) => {
|
||||
app.component(Component.name || 'LayTooltip', Component)
|
||||
}
|
||||
|
||||
export default Component as IDefineComponent
|
||||
30
src/module/tooltip/index.vue
Normal file
30
src/module/tooltip/index.vue
Normal file
@@ -0,0 +1,30 @@
|
||||
<script lang="ts">
|
||||
import usePopper from "../popper/usePopper";
|
||||
import { defineComponent} from "vue";
|
||||
export default defineComponent({
|
||||
name: "LayTooltip",
|
||||
props: {
|
||||
content: {
|
||||
type: String,
|
||||
required: true,
|
||||
},
|
||||
position: {
|
||||
type: String,
|
||||
default: "top",
|
||||
},
|
||||
isDark: {
|
||||
type: Boolean,
|
||||
default: true,
|
||||
}
|
||||
},
|
||||
render() {
|
||||
return this.$slots.default && this.$slots.default()[0];
|
||||
},
|
||||
mounted() {
|
||||
const _this = this;
|
||||
this.$nextTick(() => {
|
||||
usePopper.createPopper(_this.$el, _this.$props, "hover");
|
||||
});
|
||||
},
|
||||
});
|
||||
</script>
|
||||
Reference in New Issue
Block a user