本文介绍了PrimeFlex利润率在Vue3应用程序中不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想在我的Vue3应用程序中对PrimeVue元素应用一些边距。基于文档中的示例
https://www.primefaces.org/primevue/showcase/#/selectbutton
我有一个在图标和文本之间留有边距的工作示例
数据-lang="js"数据-隐藏="真"数据-控制台="真"数据-巴贝尔="假"><!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width,initial-scale=1.0" />
<!-- PrimeVue -->
<link href="https://unpkg.com/primevue@^3/resources/themes/saga-blue/theme.css" rel="stylesheet" />
<link href="https://unpkg.com/primevue@^3/resources/primevue.min.css" rel="stylesheet" />
<link href="https://unpkg.com/[email protected]/primeflex.min.css" rel="stylesheet" />
<link href="https://unpkg.com/primeicons/primeicons.css" rel="stylesheet" />
<!-- Dependencies -->
<script src="https://unpkg.com/vue@next"></script>
<script src="https://unpkg.com/primevue@^3/core/core.js"></script>
<!-- Demo -->
<script src="https://unpkg.com/primevue@^3/selectbutton/selectbutton.min.js"></script>
<link href="./index.css" rel="stylesheet" />
</head>
<body>
<div id="app">
<p-selectbutton v-model="selectedValue" :options="options" dataKey="value">
<template #option="slotProps">
<i class="pi pi-check-circle" />
<span class="p-ml-4">Some text</span>
</template>
</p-selectbutton>
</div>
<script type="module">
const { createApp, ref } = Vue;
const App = {
setup() {
const selectedValue = ref();
const options = ref([
{ value: 'left' },
{ value: 'right' }
]);
return { selectedValue, options }
},
components: {
"p-selectbutton": primevue.selectbutton
}
};
createApp(App)
.use(primevue.config.default)
.mount("#app");
</script>
</body>
</html>