I am able to get a simple table working. When I added options to allow column resize, the resize options fail.
Am I missing some dependencies in the components I need?
I hope to use more complex elements this way, but I am worried that I just can't do that once I get beyond simple components and scenarios.
Code: Select all
<html>
<head>
<meta charset="utf-8">
<title>PrimeVue Demo</title>
<link href="https://unpkg.com/primevue@3.1.1/resources/themes/saga-blue/theme.css" rel="stylesheet">
<link href="https://unpkg.com/primevue@3.1.1/resources/primevue.min.css" rel="stylesheet">
<link href="https://unpkg.com/primeicons@4.1.0/primeicons.css" rel="stylesheet">
<link href="https://unpkg.com/primeflex@2.0.0/primeflex.css" rel="stylesheet">
<script src="https://unpkg.com/vue@3.0.5/dist/vue.global.js"></script>
<script src="https://unpkg.com/primevue@3.1.1/components/datatable/datatable.umd.min.js"></script>
<script src="https://unpkg.com/primevue@3.1.1/components/column/column.umd.min.js"></script>
</head>
<body>
<div id="app">
<DataTable :value="products" :gibberish="true" :resizableColumns="true" columnResizeMode="expand" class="p-datatable-gridlines editable-cells-table" editMode="cell">
<Column field="id" header="ID"></Column>
<Column field="name" header="Name"></Column>
<Column field="category" header="Category"></Column>
<Column field="quantity" header="Quantity"></Column>
</DataTable>
</div>
<script>
const ComponentsApp = {
data() {
return {
products: [
{ id: 0, name: 'Vegetables' },
{ id: 1, name: 'Cheese' },
{ id: 2, name: 'Whatever else humans are supposed to eat' }
]
}
}
}
const app = Vue.createApp(ComponentsApp);
app.component('datatable', datatable);
app.component('column', column);
app.mount('#app')
</script>
</body>
</html>