mirror of
https://github.com/element-plus/element-plus.git
synced 2026-03-13 07:51:17 +08:00
feat(docs): Dropdown code for composition (#2194)
Co-authored-by: 无星 <32910694@qq.com>
This commit is contained in:
@@ -90,6 +90,24 @@ Use the button to trigger the dropdown list.
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<!--
|
||||
<setup>
|
||||
|
||||
import { defineComponent } from 'vue';
|
||||
|
||||
export default defineComponent({
|
||||
setup() {
|
||||
const handleClick = () => {
|
||||
alert('button click');
|
||||
};
|
||||
return {
|
||||
handleClick,
|
||||
};
|
||||
},
|
||||
});
|
||||
|
||||
</setup>
|
||||
-->
|
||||
```
|
||||
:::
|
||||
|
||||
@@ -245,6 +263,26 @@ Clicking each dropdown item fires an event whose parameter is assigned by each i
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<!--
|
||||
<setup>
|
||||
|
||||
import { defineComponent } from 'vue';
|
||||
import { ElMessage } from 'element-plus';
|
||||
|
||||
export default defineComponent({
|
||||
setup() {
|
||||
|
||||
const handleCommand = (command) => {
|
||||
ElMessage(`click on item ${command}`);
|
||||
};
|
||||
return {
|
||||
handleCommand,
|
||||
};
|
||||
},
|
||||
});
|
||||
|
||||
</setup>
|
||||
-->
|
||||
```
|
||||
:::
|
||||
|
||||
|
||||
@@ -91,6 +91,24 @@ Utilizando un botón para activar la lista desplegable.
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<!--
|
||||
<setup>
|
||||
|
||||
import { defineComponent } from 'vue';
|
||||
|
||||
export default defineComponent({
|
||||
setup() {
|
||||
const handleClick = () => {
|
||||
alert('button click');
|
||||
};
|
||||
return {
|
||||
handleClick,
|
||||
};
|
||||
},
|
||||
});
|
||||
|
||||
</setup>
|
||||
-->
|
||||
```
|
||||
:::
|
||||
|
||||
@@ -247,6 +265,26 @@ Al hacer clic en cada elemento desplegable se detona un evento cuyo parámetro e
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<!--
|
||||
<setup>
|
||||
|
||||
import { defineComponent } from 'vue';
|
||||
import { ElMessage } from 'element-plus';
|
||||
|
||||
export default defineComponent({
|
||||
setup() {
|
||||
|
||||
const handleCommand = (command) => {
|
||||
ElMessage(`click on item ${command}`);
|
||||
};
|
||||
return {
|
||||
handleCommand,
|
||||
};
|
||||
},
|
||||
});
|
||||
|
||||
</setup>
|
||||
-->
|
||||
```
|
||||
:::
|
||||
|
||||
|
||||
@@ -90,6 +90,24 @@ Utilisez le bouton pour ouvrir le menu déroulant.
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<!--
|
||||
<setup>
|
||||
|
||||
import { defineComponent } from 'vue';
|
||||
|
||||
export default defineComponent({
|
||||
setup() {
|
||||
const handleClick = () => {
|
||||
alert('button click');
|
||||
};
|
||||
return {
|
||||
handleClick,
|
||||
};
|
||||
},
|
||||
});
|
||||
|
||||
</setup>
|
||||
-->
|
||||
```
|
||||
:::
|
||||
|
||||
@@ -246,6 +264,26 @@ Le paramètre de cet évènement peut être assigné à chaque élément de la l
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<!--
|
||||
<setup>
|
||||
|
||||
import { defineComponent } from 'vue';
|
||||
import { ElMessage } from 'element-plus';
|
||||
|
||||
export default defineComponent({
|
||||
setup() {
|
||||
|
||||
const handleCommand = (command) => {
|
||||
ElMessage(`click on item ${command}`);
|
||||
};
|
||||
return {
|
||||
handleCommand,
|
||||
};
|
||||
},
|
||||
});
|
||||
|
||||
</setup>
|
||||
-->
|
||||
```
|
||||
:::
|
||||
|
||||
|
||||
@@ -90,6 +90,24 @@ dropdownリストを起動するには、ボタンを使用します。
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<!--
|
||||
<setup>
|
||||
|
||||
import { defineComponent } from 'vue';
|
||||
|
||||
export default defineComponent({
|
||||
setup() {
|
||||
const handleClick = () => {
|
||||
alert('button click');
|
||||
};
|
||||
return {
|
||||
handleClick,
|
||||
};
|
||||
},
|
||||
});
|
||||
|
||||
</setup>
|
||||
-->
|
||||
```
|
||||
:::
|
||||
|
||||
@@ -245,6 +263,26 @@ dropdownリストを起動するには、ボタンを使用します。
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<!--
|
||||
<setup>
|
||||
|
||||
import { defineComponent } from 'vue';
|
||||
import { ElMessage } from 'element-plus';
|
||||
|
||||
export default defineComponent({
|
||||
setup() {
|
||||
|
||||
const handleCommand = (command) => {
|
||||
ElMessage(`click on item ${command}`);
|
||||
};
|
||||
return {
|
||||
handleCommand,
|
||||
};
|
||||
},
|
||||
});
|
||||
|
||||
</setup>
|
||||
-->
|
||||
```
|
||||
:::
|
||||
|
||||
|
||||
@@ -91,7 +91,24 @@
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<!--
|
||||
<setup>
|
||||
|
||||
import { defineComponent } from 'vue';
|
||||
|
||||
export default defineComponent({
|
||||
setup() {
|
||||
const handleClick = () => {
|
||||
alert('button click');
|
||||
};
|
||||
return {
|
||||
handleClick,
|
||||
};
|
||||
},
|
||||
});
|
||||
|
||||
</setup>
|
||||
-->
|
||||
```
|
||||
:::
|
||||
|
||||
@@ -246,6 +263,26 @@
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<!--
|
||||
<setup>
|
||||
|
||||
import { defineComponent } from 'vue';
|
||||
import { ElMessage } from 'element-plus';
|
||||
|
||||
export default defineComponent({
|
||||
setup() {
|
||||
|
||||
const handleCommand = (command) => {
|
||||
ElMessage(`click on item ${command}`);
|
||||
};
|
||||
return {
|
||||
handleCommand,
|
||||
};
|
||||
},
|
||||
});
|
||||
|
||||
</setup>
|
||||
-->
|
||||
```
|
||||
:::
|
||||
|
||||
|
||||
Reference in New Issue
Block a user