javascript – How to calculate the subtotal, the discount, the shipping costs, the taxes and the total with VUE?

I have a component: (the w comes from a personal framework but works in the same way as a b-table bootstrap array)


and in the data I have the list armed without calculating the values ​​but they are written:

Articles: [
        {message: 'SUBTOTAL', value: 100},
        {message: 'DESCUENTO', value: 20},
        {message: 'ENVÍO', value: 10},
        {message: 'IMPUESTO', value: 21},
        {message: 'TOTAL', value: 111}

but I have to calculate the subtotal, discount, shipping, taxes and total in a function to be able to generalize this data since this table corresponds to a list of abandoned baskets of a website.

The parameters of my data model are:

subtotal, discount, taxes, shipping, total.

I also have the price, the quantity, the summary.

How to correctly execute the function so that it calculates the values?

Question on the call of the on-site SP REST API 2016 with a third-party VUE application

I am trying to call the SP 2016 SP REST API on a third party VUE.js application (interdomain) and I am struggling on the problem of authentication.

  1. To avoid the problem between domains, I try to call the REST API via SP.RequestExecutor.js. But in the Network tab, I see "401 unauthorized" at the request of AppWebProxy.aspx when the following code is executed.

var executor = new SP.RequestExecutor (appweburl);
executor.executeAsync (
appweburl + "/_api/SP.AppContextSite(@target)/web/lists?@target=" + hostweburl
+ "& # 39;" method: "GET", headers: {"Accept": "application / json; odata = verbose"}, success: successHandler,
error: errorHandler

1.2. When I try to test the REST API'{guidBuch')/items, the error message Below is the poster:

"Fault": {
"code": "-2147024891, System.UnauthorizedAccessException",
"message": {
"lang": "en-US",
"value": "Access denied, you are not authorized to perform this action or access this resource."

My question is: how to pass the authentication when I call the REST API in js code?

Thank you all in advance.

javascript – PWA – with Vue and Vuex

I have trouble displaying the list in real time on smartphones,

Vuex caught with calculated:

productsFiltrados () {
return store.state.listProducts.filter ((product) => {
let query = ();
returns query.match (this.busca.toUpperCase ())

On the web, rendering is only perfect on smartphones whose list is locked. Only the rendering works if I erase something in the search.


Someone knows how to get around this situation on his smartphone?

How can I pass the router settings to import a declaration into Vue?

I have road rule:

path: something /: category / index,
name: & # 39; index & # 39;
component: () => import (/ * webpackChunkName: "[request]"* /` @module / $ {category ???} / index.vue`)

how can I spend the Category var to use inside the import a function?