SpreadJS supports Vue - a JavaScript framework that provides developers with distinct tools in order to help them build complex user interfaces and web applications.
SpreadJS can be used with Vue in the following two ways:
This method involves the following steps:
Open the command prompt window and type the following commands in order to create a simple Vue project with vue init webpack.
$ npm install --global vue-cli # create a new project using the "webpack" template # install dependencies and go! |
After you finish, the Vue project will be created at the specified location in the directory. For more information on how to create a Vue project, refer to https://vuejs.org/v2/guide/installation.html.
Next, you need to install @grapecity/spread-sheets-vue in your project using the following command:
$ npm install @grapecity/spread-sheets-vue |
Now, you can modify the App.vue file as per your requirements. Changes will be reflected when the browser window is refreshed. As an example, you can use the sample code given below:
JavaScript |
Copy Code
|
---|---|
<template> </gc-worksheet> </gc-spread-sheets> |
This method involves the following steps:
As the first step, you need to create a HTML page.
Add references to the gc.spread.sheets.all.*.*.*.min.js, gc.SpreadJS.*.*.*.css and gc.spread.sheets.vue.*.*.*.js files in the HTML template (i.e. your index.html file).
Now, you can use SpreadJS in your Vue application. As an example, you can use the sample code given below:
JavaScript |
Copy Code
|
---|---|
<!DOCTYPE html> <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script> </gc-worksheet> </div> </body> |
The SpreadSheets, Worksheet, and Column are the basic elements with tag hierarchy. Other elements work by setting them. The main tag hierarchy is:
<gc-spread-sheets> <gc-worksheet> <gc-column></gc-column> ... </gc-worksheet> ... </gc-spread-sheets> |
The following topics list the element directives.