This commit is contained in:
2026-02-06 18:34:35 +08:00
commit f7f4c94c00
3285 changed files with 563208 additions and 0 deletions

View File

@@ -0,0 +1,59 @@
<template>
<JqxGrid ref="myGrid"
:width="getWidth" :columnsresize="true">
</JqxGrid>
</template>
<script>
import JqxGrid from "jqwidgets-scripts/jqwidgets-vue/vue_jqxgrid.vue";
export default {
components: {
JqxGrid
},
data: function () {
return {
getWidth: '90%'
}
},
beforeCreate: function () {
const source = {
datatype: 'json',
url: 'rows_and_columns.txt'
};
const dataAdapter = new jqx.dataAdapter(source, {
autoBind: true,
downloadComplete: (data) => {
let columns = data[0].columns;
let rows = data[1].rows;
let gridAdapter = new jqx.dataAdapter({
datafields: [
{ name: 'id', type: 'number' },
{ name: 'name', type: 'string' },
{ name: 'type', type: 'string' },
{ name: 'calories', type: 'int' },
{ name: 'totalfat', type: 'string' },
{ name: 'protein', type: 'string' }
],
id: 'id',
localdata: rows
});
this.$refs.myGrid.hideloadelement();
this.$refs.myGrid.beginupdate();
this.$refs.myGrid.setOptions
({
source: gridAdapter,
columns: columns
});
this.$refs.myGrid.endupdate();
}
});
}
}
</script>
<style>
</style>

View File

@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>jQWidgets Vue Example</title>
<link rel="stylesheet" href="node_modules/jqwidgets-scripts/jqwidgets/styles/jqx.base.css" type="text/css" />
<script src="https://www.jqwidgets.com/jquery-widgets-demo/demos/jqxgrid/generatedata.js"></script> </head>
<body>
<div id="app"></div>
<script src="dist/main.bundle.js"></script>
</body>
</html>

View File

@@ -0,0 +1,10 @@
import Vue from 'vue'
import App from './App'
Vue.config.productionTip = false
new Vue({
el: '#app',
components: { App },
template: '<App/>'
})

View File

@@ -0,0 +1,33 @@
{
"name": "jQWidgets_Vue_Demo",
"version": "1.0.0",
"description": "Vue.js Demos Build Project",
"author": "www.jqwidgets.com <sales@jqwidgets.com>",
"private": true,
"scripts": {
"build": "webpack --config webpack.config.js",
"start": "npm run build"
},
"devDependencies": {
"autoprefixer": "^7.1.2",
"css-loader": "^0.28.11",
"extract-text-webpack-plugin": "^3.0.0",
"file-loader": "^1.1.4",
"jqwidgets-scripts": "~6.1.0",
"portfinder": "^1.0.13",
"postcss-import": "^11.0.0",
"postcss-loader": "^2.0.8",
"postcss-url": "^7.2.1",
"style-loader": "^0.23.0",
"uglifyjs-webpack-plugin": "^1.1.1",
"url-loader": "^0.5.8",
"vue": "^2.5.2",
"vue-loader": "^13.3.0",
"vue-style-loader": "^3.0.1",
"vue-template-compiler": "^2.5.2",
"webpack": "^3.6.0",
"webpack-bundle-analyzer": "^2.9.0",
"webpack-dev-server": "^2.9.1",
"webpack-merge": "^4.1.0"
}
}

View File

@@ -0,0 +1,271 @@
[
{
"columns": [
{
"text": "ID",
"datafield": "id",
"width": "30"
},
{
"text": "Name",
"datafield": "name",
"width": "250"
},
{
"text": "Beverage Type",
"datafield": "type",
"width": "250"
},
{
"text": "Calories",
"datafield": "calories",
"width": "180"
},
{
"text": "Total Fat",
"datafield": "totalfat",
"width": "120"
},
{
"text": "Protein",
"datafield": "protein"
}
]
},
{
"rows": [
{
"id": "1",
"name": "Hot Chocolate",
"type": "Chocolate Beverage",
"calories": "370",
"totalfat": "16g",
"protein": "14g"
},
{
"id": 2,
"name": "Peppermint Hot Chocolate",
"type": "Chocolate Beverage",
"calories": "440",
"totalfat": "16g",
"protein": "13g"
},
{
"id": "3",
"name": "Salted Caramel Hot Chocolate",
"type": "Chocolate Beverage",
"calories": "450",
"totalfat": "16g",
"protein": "13g"
},
{
"id": "4",
"name": "White Hot Chocolate",
"type": "Chocolate Beverage",
"calories": "420",
"totalfat": "16g",
"protein": "12g"
},
{
"id": "5",
"name": "Caffe Americano",
"type": "Espresso Beverage",
"calories": "15",
"totalfat": "0g",
"protein": "1g"
},
{
"id": "6",
"name": "Caffe Latte",
"type": "Espresso Beverage",
"calories": "190",
"totalfat": "7g",
"protein": "12g"
},
{
"id": "7",
"name": "Caffe Mocha",
"type": "Espresso Beverage",
"calories": "330",
"totalfat": "15g",
"protein": "13g"
},
{
"id": "8",
"name": "Cappuccino",
"type": "Espresso Beverage",
"calories": "120",
"totalfat": "4g",
"protein": "8g"
},
{
"id": "9",
"name": "Caramel Brulee Latte",
"type": "Espresso Beverage",
"calories": "420",
"totalfat": "9g",
"protein": "8g"
},
{
"id": "10",
"name": "Caramel Macchiato",
"type": "Espresso Beverage",
"calories": "240",
"totalfat": "11g",
"protein": "10g"
},
{
"id": "11",
"name": "Peppermint Hot Chocolate",
"type": "Espresso Beverage",
"calories": "440",
"totalfat": "10g",
"protein": "13g"
},
{
"id": "12",
"name": "Cinnamon Dolce Latte",
"type": "Espresso Beverage",
"calories": "260",
"totalfat": "6g",
"protein": "10g"
},
{
"id": "13",
"name": "Eggnog Latte",
"type": "Espresso Beverage",
"calories": "460",
"totalfat": "16g",
"protein": "13g"
},
{
"id": "14",
"name": "Espresso",
"type": "Espresso Beverage",
"calories": "5",
"totalfat": "1g",
"protein": "1g"
},
{
"id": "15",
"name": "Espresso Con Panna",
"type": "Espresso Beverage",
"calories": "30",
"totalfat": "1g",
"protein": "0g"
},
{
"id": "16",
"name": "Espresso Macchiato",
"type": "Espresso Beverage",
"calories": "100",
"totalfat": "1g",
"protein": "0g"
},
{
"id": "17",
"name": "Flavored Latte",
"type": "Espresso Beverage",
"calories": "250",
"totalfat": "6g",
"protein": "12g"
},
{
"id": "18",
"name": "Gingerbread Latte",
"type": "Espresso Beverage",
"calories": "320",
"totalfat": "13g",
"protein": "12g"
},
{
"id": "19",
"name": "White Chocolate Mocha",
"type": "Espresso Beverage",
"calories": "470",
"totalfat": "18g",
"protein": "15g"
},
{
"id": 20,
"name": "Skinny Peppermint Mocha",
"type": "Espresso Beverage",
"calories": 130,
"totalfat": "15g",
"protein": "13g"
},
{
"id": "21",
"name": "Skinny Flavored Latte",
"type": "Espresso Beverage",
"calories": "120",
"totalfat": "0g",
"protein": "12g"
},
{
"id": "22",
"name": "Pumpkin Spice Latte",
"type": "Espresso Beverage",
"calories": "380",
"totalfat": "13g",
"protein": "14g"
},
{
"id": "23",
"name": "Caffe Vanilla Frappuccino",
"type": "Frappuccino Blended Beverage",
"calories": "310",
"totalfat": "3g",
"protein": "3g"
},
{
"id": "24",
"name": "Caffe Vanilla Frappuccino Light",
"type": "Frappuccino Blended Beverage",
"calories": "180",
"totalfat": "0g",
"protein": "3g"
},
{
"id": "25",
"name": "Caramel Brulee Frappuccino",
"type": "Frappuccino Blended Beverage",
"calories": "410",
"totalfat": "13g",
"protein": "4g"
},
{
"id": "26",
"name": "Caramel Brulee Frappuccino Light",
"type": "Frappuccino Blended Beverage",
"calories": "190",
"totalfat": "0g",
"protein": "3g"
},
{
"id": "27",
"name": "Eggnog Frappuccino",
"type": "Frappuccino Blended Beverage",
"calories": "420",
"totalfat": "18g",
"protein": "7g"
},
{
"id": "28",
"name": "Mocha Frappuccino",
"type": "Frappuccino Blended Beverage",
"calories": "400",
"totalfat": "15g",
"protein": "5g"
},
{
"id": "29",
"name": "Tazo Green Tea Creme Frappuccino",
"type": "Frappuccino Blended Beverage",
"calories": "430",
"totalfat": "16g",
"protein": "6g"
}
]
}
]

View File

@@ -0,0 +1,50 @@
'use strict'
const path = require('path')
const webpack = require('webpack')
const UglifyJsPlugin = require('uglifyjs-webpack-plugin')
module.exports = {
entry: {
main: './main.js'
},
output: {
path: path.resolve(__dirname + '/dist'),
filename: '[name].bundle.js'
},
resolve: {
extensions: ['.js', '.vue'],
alias: {
'vue$': 'vue/dist/vue.esm.js',
'@': path.resolve(__dirname + '/src'),
}
},
module: {
rules: [
{
test: /\.vue$/,
loader: 'vue-loader'
},
{
test: /\.(png|jpe?g|gif|svg)(\?.*)?$/,
loader: 'url-loader'
},
{
test: /\.css$/,
loaders: ['style-loader', 'css-loader']
}
]
},
plugins: [
// strip all the warnings from Vue.js source code.
new webpack.DefinePlugin({
'process.env': {
NODE_ENV: '"production"'
}
}),
// uglify build code
new UglifyJsPlugin({
// this speeds up the build
parallel: true
})
]
}