Сначала я добавил зависимости в package.json, как показано ниже. : < /p>
Код: Выделить всё
"dependencies": {
"ag-charts-enterprise": "^11.0.4",
"ag-grid-community": "^33.0.4",
"ag-grid-enterprise": "^33.0.4"
}
Код: Выделить всё
import 'ag-grid-enterprise';
import 'ag-charts-enterprise';
import 'ag-grid-community/styles/ag-grid.css';
import 'ag-grid-community/styles/ag-theme-quartz.css';
import { LicenseManager } from 'ag-grid-enterprise';
LicenseManager.setLicenseKey("my_trial_license_code");
import * as agGrid from 'ag-grid-community';
window.agGrid = agGrid;
Это мой содержимое файла Blade:
@vite(['resources/js/app.js', 'resources/css/app.css'])
let gridApi;
// Grid Options: Contains all of the grid configurations
const gridOptions = {
// Data to be displayed
rowData: [
{ make: "Tesla", model: "Model Y", price: 64950, electric: true },
{ make: "Ford", model: "F-Series", price: 33850, electric: false },
{ make: "Toyota", model: "Corolla", price: 29600, electric: false },
{ make: "Mercedes", model: "EQA", price: 48890, electric: true },
{ make: "Fiat", model: "500", price: 15774, electric: false },
{ make: "Nissan", model: "Juke", price: 20675, electric: false },
],
// Columns to be displayed (Should match rowData properties)
columnDefs: [
{ field: "make" },
{ field: "model" },
{ field: "price" },
{ field: "electric" },
],
defaultColDef: {
flex: 1,
},
};
// Create Grid: Create new grid within the #myGrid div, using the Grid Options object
gridApi = agGrid.createGrid(document.querySelector("#myGrid"), gridOptions);
< /code>
Где я испорчу? Заранее спасибо.
Подробнее здесь: https://stackoverflow.com/questions/793 ... in-laravel
Мобильная версия