修复 src 结构

This commit is contained in:
就眠儀式
2022-01-22 21:30:17 +08:00
parent 96bb84020b
commit d0debbb1b2
186 changed files with 251 additions and 251 deletions

View 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 || "LayRadio ", Component);
};
export default Component as IDefineComponent;

View File

@@ -0,0 +1,46 @@
<template>
<span>
<input type="radio" :value="label" :name="name" />
<div
class="layui-unselect layui-form-radio"
:class="{
'layui-form-radioed': modelValue == label,
'layui-radio-disbaled layui-disabled': disabled,
}"
@click.stop="handleClick"
>
<i
v-if="modelValue == label"
class="layui-anim layui-icon layui-anim-scaleSpring"
>&#xe643;</i
>
<i
v-else
class="layui-anim layui-icon layui-anim-scaleSpring layui-form-radioed"
>&#xe63f;</i
>
<span><slot></slot></span>
</div>
</span>
</template>
<script setup name="LayRadio" lang="ts">
import { defineProps, defineEmits } from "vue";
const props = defineProps<{
modelValue: string;
disabled?: boolean;
label?: string;
name: string;
}>();
const emit = defineEmits(["update:modelValue", "change"]);
const handleClick = function () {
if (props.disabled) {
return;
}
emit("change", props.label);
emit("update:modelValue", props.label);
};
</script>