Giter Club home page Giter Club logo

spofvue's Introduction

This is a basic demo project using Odata API (SharePoint uses Odata 2.0) to get data (posting data is similar and reference can be found in the links below.)

This uses the Vue composition API structure and binds asynchronous API call data to the view model using Pinia state management.

For this demo, I am using an Odata open API (see the HelloWorld.vue onMounted hook) for a an axios get command.
Functionaly, SharePoint API follows Odata 2.0 spec found here.
In practice, in the local development environment, you will need to use a proxy service locally to be able to avoid cross-site-scripting issues.
This Proxy works well.

This project setup:

npm init vite@latest spofvue --template vue
select the vue template
select the javascript variant

install basic quasar:
npm install quasar @quasar/extras
npm install -D @quasar/vite-plugin [email protected]

install pinia: npm install pinia
install axios: npm install axios

   You can find Microsoft SharePoint REST API documentation <a href="https://learn.microsoft.com/en-us/sharepoint/dev/sp-add-ins/working-with-lists-and-list-items-with-rest">here</a><br /><br />
  Common Odata API endpoints for SharePoint:<br />
  <span class="text-deep-orange">_api/web/lists/GetByTitle('List Title')</span> (gets information about the list)<br />
  <span class="text-deep-orange">_api/web/lists/GetByTitle('List Title')/fields</span> (gets schema data about the list structure - 
  I use this data to inject into the view model dynamically, so extensive TypeScript definitions of the schema in code are not required)<br />
  <span class="text-deep-orange">_api/web/lists/GetByTitle('List Title')/items</span> (gets actual data from the list, think of this as a data table in a database server) <br /><br />
  Once you have the data in the view model, then it can be interacted with and mutated (if needed) and then POST back to SharePoint.<br />

spofvue's People

Contributors

netsuper avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.