mirror of
https://github.com/apache/skywalking-booster-ui.git
synced 2025-07-14 07:05:27 +00:00
fix: update selectors
This commit is contained in:
parent
227ef4f092
commit
fe81197d49
@ -44,10 +44,11 @@ const props = defineProps({
|
|||||||
type: Array as PropType<Option[]>,
|
type: Array as PropType<Option[]>,
|
||||||
default: () => [],
|
default: () => [],
|
||||||
},
|
},
|
||||||
|
value: { type: String, default: "" },
|
||||||
size: { type: String, default: "small" },
|
size: { type: String, default: "small" },
|
||||||
placeholder: { type: String, default: "Select a option" },
|
placeholder: { type: String, default: "Select a option" },
|
||||||
});
|
});
|
||||||
const selected = ref<string>("");
|
const selected = ref<string>(props.value);
|
||||||
function changeSelected() {
|
function changeSelected() {
|
||||||
const optionSele = props.options.filter(
|
const optionSele = props.options.filter(
|
||||||
(d: Option) => d.value === selected.value
|
(d: Option) => d.value === selected.value
|
||||||
|
@ -26,6 +26,7 @@ limitations under the License. -->
|
|||||||
<div class="item">
|
<div class="item">
|
||||||
<div class="label">{{ t("layer") }}</div>
|
<div class="label">{{ t("layer") }}</div>
|
||||||
<Selector
|
<Selector
|
||||||
|
:value="states.layer"
|
||||||
:options="Options"
|
:options="Options"
|
||||||
size="small"
|
size="small"
|
||||||
placeholder="Select a layer"
|
placeholder="Select a layer"
|
||||||
@ -36,6 +37,7 @@ limitations under the License. -->
|
|||||||
<div class="item">
|
<div class="item">
|
||||||
<div class="label">{{ t("entityType") }}</div>
|
<div class="label">{{ t("entityType") }}</div>
|
||||||
<Selector
|
<Selector
|
||||||
|
:value="states.entity"
|
||||||
:options="EntityType"
|
:options="EntityType"
|
||||||
size="small"
|
size="small"
|
||||||
placeholder="Select a entity"
|
placeholder="Select a entity"
|
||||||
@ -63,7 +65,7 @@ const { t } = useI18n();
|
|||||||
const selectorStore = useSelectorStore();
|
const selectorStore = useSelectorStore();
|
||||||
const states = reactive({
|
const states = reactive({
|
||||||
name: "",
|
name: "",
|
||||||
layer: "",
|
layer: Options[0].value,
|
||||||
entity: EntityType[0].value,
|
entity: EntityType[0].value,
|
||||||
});
|
});
|
||||||
const onCreate = () => {
|
const onCreate = () => {
|
||||||
|
@ -33,23 +33,23 @@ export const EntityType = [
|
|||||||
];
|
];
|
||||||
export const Options = [
|
export const Options = [
|
||||||
{
|
{
|
||||||
value: "Option1",
|
value: "layer1",
|
||||||
label: "Option1",
|
label: "layer1",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
value: "Option2",
|
value: "layer2",
|
||||||
label: "Option2",
|
label: "layer2",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
value: "Option3",
|
value: "layer3",
|
||||||
label: "Option3",
|
label: "layer3",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
value: "Option4",
|
value: "layer4",
|
||||||
label: "Option4",
|
label: "layer4",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
value: "Option5",
|
value: "layer5",
|
||||||
label: "Option5",
|
label: "layer5",
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
Loading…
Reference in New Issue
Block a user