From 66c21c72c93e197f6ee73a2247183133b8f594c8 Mon Sep 17 00:00:00 2001 From: Pwntus Date: Wed, 10 Jul 2019 21:21:20 +0200 Subject: [PATCH 01/35] docs: API until errorHandler --- src/v2/api/index.md | 58 +++++++++++++++++++++++---------------------- 1 file changed, 30 insertions(+), 28 deletions(-) diff --git a/src/v2/api/index.md b/src/v2/api/index.md index ad585ce963..7818ba1ae5 100644 --- a/src/v2/api/index.md +++ b/src/v2/api/index.md @@ -3,31 +3,31 @@ title: API type: api --- -## Global Config +## Global Konfiguration -`Vue.config` is an object containing Vue's global configurations. You can modify its properties listed below before bootstrapping your application: +`Vue.config` är ett objekt som innehåller Vue's globala konfigurationer. Du kan modifiera dess egenskaper som är listade nedan före du startar din applikation. ### silent -- **Type:** `boolean` +- **Typ:** `boolean` -- **Default:** `false` +- **Standardvärde:** `false` -- **Usage:** +- **Användning:** ``` js Vue.config.silent = true ``` - Suppress all Vue logs and warnings. + Tysta alla logg- och varningsmeddelanden från Vue. ### optionMergeStrategies -- **Type:** `{ [key: string]: Function }` +- **Typ:** `{ [key: string]: Function }` -- **Default:** `{}` +- **Standardvärde:** `{}` -- **Usage:** +- **Användning:** ``` js Vue.config.optionMergeStrategies._my_option = function (parent, child, vm) { @@ -41,52 +41,54 @@ type: api // Profile.options._my_option = 2 ``` - Define custom merging strategies for options. + Definiera anpassade sammanfogningsstrategier för options. - The merge strategy receives the value of that option defined on the parent and child instances as the first and second arguments, respectively. The context Vue instance is passed as the third argument. + Sammanfogningsstrategien erhåller värdet av alternativet som är definierat på föräldra och barninstansen som det första och andra argumentet. Kontextinstansen av Vue skickas som det tredje argumentet. -- **See also:** [Custom Option Merging Strategies](../guide/mixins.html#Custom-Option-Merge-Strategies) +- **Läs även:** [Anpassade Sammanfogningsstrategier För Alternativ](../guide/mixins.html#Custom-Option-Merge-Strategies) ### devtools -- **Type:** `boolean` +- **Typ:** `boolean` -- **Default:** `true` (`false` in production builds) +- **Standardvärde:** `true` (`false` i produktionsläge) -- **Usage:** +- **Användning:** ``` js - // make sure to set this synchronously immediately after loading Vue + // var noga med att sätta detta värdet synkront direkt efter att du startat Vue Vue.config.devtools = true ``` - Configure whether to allow [vue-devtools](https://github.com/vuejs/vue-devtools) inspection. This option's default value is `true` in development builds and `false` in production builds. You can set it to `true` to enable inspection for production builds. + Konfigurera huruvida inspektion av [vue-devtools](https://github.com/vuejs/vue-devtools) tillåts. + + Standardvärdet av detta alternativet är `true` i utvecklingsläge och `false` i produktionsläge. Du kan sätta det till `true` för att tillåta inspektion i produktionsläge. ### errorHandler -- **Type:** `Function` +- **Typ:** `Function` -- **Default:** `undefined` +- **Standardvärde:** `undefined` -- **Usage:** +- **Användning:** ``` js Vue.config.errorHandler = function (err, vm, info) { - // handle error - // `info` is a Vue-specific error info, e.g. which lifecycle hook - // the error was found in. Only available in 2.2.0+ + // felhantering + // `info` är ett Vue-specifikt felmeddelande, t.ex. vilken lifecycle hook + // felet uppstod i. Endast tillgänglig i 2.2.0+ } ``` - Assign a handler for uncaught errors during component render function and watchers. The handler gets called with the error and the Vue instance. + Tilldela en hanterare för ofångade fel som uppstått under komponentrendering och watchers. Hanteraren anropas med felet och Vue-instansen. - > In 2.2.0+, this hook also captures errors in component lifecycle hooks. Also, when this hook is `undefined`, captured errors will be logged with `console.error` instead of crashing the app. + > I 2.2.0+ kommer denna hook även fånga fel i lifecycle hooks i komponenter. När denna hook är `undefined` kommer fångade fel bli loggade med `console.error` istället för att krascha applikationen. - > In 2.4.0+, this hook also captures errors thrown inside Vue custom event handlers. + > I 2.4.0+ kommer denna hook även fånga fel som uppstår i anpassade Vue händelsehanterare. - > In 2.6.0+, this hook also captures errors thrown inside `v-on` DOM listeners. In addition, if any of the covered hooks or handlers returns a Promise chain (e.g. async functions), the error from that Promise chain will also be handled. + > I 2.6.0+ kommer denna hook även fånga fel som uppstår i `v-on` DOM lyssnare. Om någon av de gällande hookarna eller hanterarna returnerar en Promise-kedja, kommer felet från kedjan även bli hanterat. - > Error tracking services [Sentry](https://sentry.io/for/vue/) and [Bugsnag](https://docs.bugsnag.com/platforms/browsers/vue/) provide official integrations using this option. + > Felsökningstjänsterna [Sentry](https://sentry.io/for/vue/) och [Bugsnag](https://docs.bugsnag.com/platforms/browsers/vue/) förser officiella integrationer som utnyttjar detta alternativet. ### warnHandler From 1d979a954178efac0507491bf15b56c40491d1ca Mon Sep 17 00:00:00 2001 From: Pwntus Date: Wed, 10 Jul 2019 21:25:53 +0200 Subject: [PATCH 02/35] fix: avoid capitalization in title --- src/v2/api/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/v2/api/index.md b/src/v2/api/index.md index 7818ba1ae5..51b2ab42c3 100644 --- a/src/v2/api/index.md +++ b/src/v2/api/index.md @@ -3,7 +3,7 @@ title: API type: api --- -## Global Konfiguration +## Global konfiguration `Vue.config` är ett objekt som innehåller Vue's globala konfigurationer. Du kan modifiera dess egenskaper som är listade nedan före du startar din applikation. From 5e1b3055832346efc2764d42e38229c7906a0bf7 Mon Sep 17 00:00:00 2001 From: Pwntus Date: Wed, 10 Jul 2019 21:54:08 +0200 Subject: [PATCH 03/35] fix: add first occurrence parentheses --- src/v2/api/index.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/v2/api/index.md b/src/v2/api/index.md index 51b2ab42c3..579ceb62e1 100644 --- a/src/v2/api/index.md +++ b/src/v2/api/index.md @@ -5,7 +5,7 @@ type: api ## Global konfiguration -`Vue.config` är ett objekt som innehåller Vue's globala konfigurationer. Du kan modifiera dess egenskaper som är listade nedan före du startar din applikation. +`Vue.config` är ett objekt som innehåller Vue's globala konfigurationer. Du kan modifiera dess egenskaper (properties) som är listade nedan före du startar din applikation. ### silent @@ -41,7 +41,7 @@ type: api // Profile.options._my_option = 2 ``` - Definiera anpassade sammanfogningsstrategier för options. + Definiera anpassade sammanfogningsstrategier för alternativ (options). Sammanfogningsstrategien erhåller värdet av alternativet som är definierat på föräldra och barninstansen som det första och andra argumentet. Kontextinstansen av Vue skickas som det tredje argumentet. @@ -80,9 +80,9 @@ type: api } ``` - Tilldela en hanterare för ofångade fel som uppstått under komponentrendering och watchers. Hanteraren anropas med felet och Vue-instansen. + Tilldela en hanterare för ofångade fel som uppstått under komponentrendering och watchers (bevakare). Hanteraren anropas med felet och Vue-instansen. - > I 2.2.0+ kommer denna hook även fånga fel i lifecycle hooks i komponenter. När denna hook är `undefined` kommer fångade fel bli loggade med `console.error` istället för att krascha applikationen. + > I 2.2.0+ kommer denna hook (krok) även fånga fel i lifecycle hooks (livscykelkrokar) i komponenter. När denna hook är `undefined` kommer fångade fel bli loggade med `console.error` istället för att krascha applikationen. > I 2.4.0+ kommer denna hook även fånga fel som uppstår i anpassade Vue händelsehanterare. From b84ca223f03dd25bbbed14f1205922d7eb1b13c4 Mon Sep 17 00:00:00 2001 From: Pwntus Date: Wed, 10 Jul 2019 22:08:20 +0200 Subject: [PATCH 04/35] docs: translate API warnHandler --- src/v2/api/index.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/v2/api/index.md b/src/v2/api/index.md index 579ceb62e1..e380f77659 100644 --- a/src/v2/api/index.md +++ b/src/v2/api/index.md @@ -92,21 +92,21 @@ type: api ### warnHandler -> New in 2.4.0+ +> Nytt i 2.4.0+ -- **Type:** `Function` +- **Typ:** `Function` -- **Default:** `undefined` +- **Standardvärde:** `undefined` -- **Usage:** +- **Användning:** ``` js Vue.config.warnHandler = function (msg, vm, trace) { - // `trace` is the component hierarchy trace + // `trace` är spårningen i komponenthierarkin } ``` - Assign a custom handler for runtime Vue warnings. Note this only works during development and is ignored in production. + Tilldela en anpassad hanterare för varningar under Vue körningen. Notera att detta endast fungerar i utvecklingsläge och ignoreras i produktionsläge. ### ignoredElements From dd4b5281619cc041288f2fde3949e10458fb30e5 Mon Sep 17 00:00:00 2001 From: Pwntus Date: Wed, 10 Jul 2019 22:14:39 +0200 Subject: [PATCH 05/35] docs: translate API ignoredElements --- src/v2/api/index.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/v2/api/index.md b/src/v2/api/index.md index e380f77659..1415fc386e 100644 --- a/src/v2/api/index.md +++ b/src/v2/api/index.md @@ -110,23 +110,23 @@ type: api ### ignoredElements -- **Type:** `Array` +- **Typ:** `Array` -- **Default:** `[]` +- **Standardvärde:** `[]` -- **Usage:** +- **Användning:** ``` js Vue.config.ignoredElements = [ 'my-custom-web-component', 'another-web-component', - // Use a `RegExp` to ignore all elements that start with "ion-" - // 2.5+ only + // Använd ett reguljärt uttryck (RegExp) för att ignorera alla element som börjar på "ion-" + // Bara i 2.5+ /^ion-/ ] ``` - Make Vue ignore custom elements defined outside of Vue (e.g., using the Web Components APIs). Otherwise, it will throw a warning about an `Unknown custom element`, assuming that you forgot to register a global component or misspelled a component name. + Tvinga Vue att ignorera anpassade element som är definierate utanför Vue (t.ex. då man använder Web Components API:et). Varningar om `Unknown custom element` kommer annars att kastas, förutsatt att du glömt att registrera en global komponent eller felstavat ett komponentnamn. ### keyCodes From 6d8016ae9eeb70783390b22f703a36e4ccc7090a Mon Sep 17 00:00:00 2001 From: Pwntus Date: Wed, 10 Jul 2019 22:18:10 +0200 Subject: [PATCH 06/35] docs: translate API keyCodes --- src/v2/api/index.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/v2/api/index.md b/src/v2/api/index.md index 1415fc386e..5c57a8cd3b 100644 --- a/src/v2/api/index.md +++ b/src/v2/api/index.md @@ -130,19 +130,19 @@ type: api ### keyCodes -- **Type:** `{ [key: string]: number | Array }` +- **Typ:** `{ [key: string]: number | Array }` -- **Default:** `{}` +- **Standardvärde:** `{}` -- **Usage:** +- **Användning:** ``` js Vue.config.keyCodes = { v: 86, f1: 112, - // camelCase won`t work + // camelCase fungerar ej mediaPlayPause: 179, - // instead you can use kebab-case with double quotation marks + // du kan istället använda kebab-case med dubbla citattecken "media-play-pause": 179, up: [38, 87] } @@ -152,7 +152,7 @@ type: api ``` - Define custom key alias(es) for `v-on`. + Definiera anpassade tangentalias för `v-on`. ### performance From accbd2b430ee3e87d0b27ec37ba2ec05eb8a02af Mon Sep 17 00:00:00 2001 From: Pwntus Date: Wed, 10 Jul 2019 22:27:15 +0200 Subject: [PATCH 07/35] docs: translate API performance --- src/v2/api/index.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/v2/api/index.md b/src/v2/api/index.md index 5c57a8cd3b..cb938a3709 100644 --- a/src/v2/api/index.md +++ b/src/v2/api/index.md @@ -156,15 +156,15 @@ type: api ### performance -> New in 2.2.0+ +> Nytt i 2.2.0+ -- **Type:** `boolean` +- **Typ:** `boolean` -- **Default:** `false (from 2.2.3+)` +- **Standardvärde:** `false (fr.o.m. 2.2.3+)` -- **Usage**: +- **Användning**: - Set this to `true` to enable component init, compile, render and patch performance tracing in the browser devtool performance/timeline panel. Only works in development mode and in browsers that support the [performance.mark](https://developer.mozilla.org/en-US/docs/Web/API/Performance/mark) API. + Sätt detta till `true` för att möjliggöra komponentinitiering, kompilering, rendering och spårninglappning för prestanda i prestanda/tidslinje -panelen i webbläsarens utvecklingsverktyg. Fungerar endast i utvecklingsläge och i webbläsare som stöder [performance.mark](https://developer.mozilla.org/en-US/docs/Web/API/Performance/mark) API:et. ### productionTip From e55ca5b144a9fa01075b9031a504d63d6e6f31bd Mon Sep 17 00:00:00 2001 From: Pwntus Date: Wed, 10 Jul 2019 22:32:55 +0200 Subject: [PATCH 08/35] docs: translate API productionTip --- src/v2/api/index.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/v2/api/index.md b/src/v2/api/index.md index cb938a3709..d7b4bd0537 100644 --- a/src/v2/api/index.md +++ b/src/v2/api/index.md @@ -168,15 +168,15 @@ type: api ### productionTip -> New in 2.2.0+ +> Nytt i 2.2.0+ -- **Type:** `boolean` +- **Typ:** `boolean` -- **Default:** `true` +- **Standardvärde:** `true` -- **Usage**: +- **Användning**: - Set this to `false` to prevent the production tip on Vue startup. + Sätt detta till `false` för att förhindra produktionstipset vid uppstart av Vue. ## Global API From 3152f60b3c36e37694c744fa662ea80ead162c61 Mon Sep 17 00:00:00 2001 From: Pwntus Date: Wed, 10 Jul 2019 22:50:23 +0200 Subject: [PATCH 09/35] docs: translate API Vue.extend() --- src/v2/api/index.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/v2/api/index.md b/src/v2/api/index.md index d7b4bd0537..59ede43425 100644 --- a/src/v2/api/index.md +++ b/src/v2/api/index.md @@ -178,25 +178,25 @@ type: api Sätt detta till `false` för att förhindra produktionstipset vid uppstart av Vue. -## Global API +## Globalt API ### Vue.extend( options ) -- **Arguments:** +- **Argument:** - `{Object} options` -- **Usage:** +- **Användning:** - Create a "subclass" of the base Vue constructor. The argument should be an object containing component options. + Skapa en "subklass" från Vue baskonstruktor. Argumentet bör vara ett objekt som inehåller komponentalternativ. - The special case to note here is the `data` option - it must be a function when used with `Vue.extend()`. + Ett specialfall att notera här är `data` alternativet - det måste vara en funktion då det används med `Vue.extend()`. ``` html
``` ``` js - // create constructor + // skapa konstruktor var Profile = Vue.extend({ template: '

{{firstName}} {{lastName}} aka {{alias}}

', data: function () { @@ -207,17 +207,17 @@ type: api } } }) - // create an instance of Profile and mount it on an element + // skapa en Profile-instans och montera den på ett element new Profile().$mount('#mount-point') ``` - Will result in: + Resulterar i detta: ``` html

Walter White aka Heisenberg

``` -- **See also:** [Components](../guide/components.html) +- **Läs även:** [Komponenter](../guide/components.html) ### Vue.nextTick( [callback, context] ) From 247b6b2e899364cc9b99a9c2da9b1ea7f5a63023 Mon Sep 17 00:00:00 2001 From: Pwntus Date: Wed, 10 Jul 2019 23:05:22 +0200 Subject: [PATCH 10/35] docs: translate API Vue.nextTick() --- src/v2/api/index.md | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/v2/api/index.md b/src/v2/api/index.md index 59ede43425..2180a6b05e 100644 --- a/src/v2/api/index.md +++ b/src/v2/api/index.md @@ -221,32 +221,32 @@ type: api ### Vue.nextTick( [callback, context] ) -- **Arguments:** +- **Argument:** - `{Function} [callback]` - `{Object} [context]` -- **Usage:** +- **Användning:** - Defer the callback to be executed after the next DOM update cycle. Use it immediately after you've changed some data to wait for the DOM update. + Uppskjut exekvering av callbackfunktionen fram tills nästa uppdateringscykel av DOM. Använd detta genast efter att du uppdaterat data för att vänta på DOM-uppdateringen. ``` js - // modify data + // modifiera data vm.msg = 'Hello' - // DOM not updated yet + // DOM är inte uppdaterad än Vue.nextTick(function () { - // DOM updated + // DOM är nu uppdaterad }) - // usage as a promise (2.1.0+, see note below) + // användning som en promise (2.1.0+, se notis nedan) Vue.nextTick() .then(function () { - // DOM updated + // DOM är nu uppdaterad }) ``` - > New in 2.1.0+: returns a Promise if no callback is provided and Promise is supported in the execution environment. Please note that Vue does not come with a Promise polyfill, so if you target browsers that don't support Promises natively (looking at you, IE), you will have to provide a polyfill yourself. + > Nytt i 2.1.0+: returnerar en Promise ifall ingen callbackfunktion är given och Promise stöds i exekveringsmiljön. Vänligen notera att det inte följer en Promise polyfill med Vue, så ifall du utvecklar mot webbläsare som inte stöder Promise (ser på dig, IE) måste du förse en polyfill själv. -- **See also:** [Async Update Queue](../guide/reactivity.html#Async-Update-Queue) +- **Läs även:** [Asynkron uppdateringskö](../guide/reactivity.html#Async-Update-Queue) ### Vue.set( target, propertyName/index, value ) From 87c1ff9d855f28ce46809641e105e92c318f9f58 Mon Sep 17 00:00:00 2001 From: Pwntus Date: Wed, 10 Jul 2019 23:06:30 +0200 Subject: [PATCH 11/35] docs: API reverst title capitalization --- src/v2/api/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/v2/api/index.md b/src/v2/api/index.md index 2180a6b05e..be70ad263f 100644 --- a/src/v2/api/index.md +++ b/src/v2/api/index.md @@ -45,7 +45,7 @@ type: api Sammanfogningsstrategien erhåller värdet av alternativet som är definierat på föräldra och barninstansen som det första och andra argumentet. Kontextinstansen av Vue skickas som det tredje argumentet. -- **Läs även:** [Anpassade Sammanfogningsstrategier För Alternativ](../guide/mixins.html#Custom-Option-Merge-Strategies) +- **Läs även:** [Anpassade sammanfogningsstrategier för alternativ](../guide/mixins.html#Custom-Option-Merge-Strategies) ### devtools From 47bf1fa006e2b055890390b8d9bae20cade8a08b Mon Sep 17 00:00:00 2001 From: Pwntus Date: Wed, 10 Jul 2019 23:14:07 +0200 Subject: [PATCH 12/35] docs: translate API Vue.set() --- src/v2/api/index.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/v2/api/index.md b/src/v2/api/index.md index be70ad263f..260ff00eed 100644 --- a/src/v2/api/index.md +++ b/src/v2/api/index.md @@ -250,20 +250,20 @@ type: api ### Vue.set( target, propertyName/index, value ) -- **Arguments:** +- **Argument:** - `{Object | Array} target` - `{string | number} propertyName/index` - `{any} value` -- **Returns:** the set value. +- **Returnerar:** det satta värdet. -- **Usage:** +- **Avändning:** - Adds a property to a reactive object, ensuring the new property is also reactive, so triggers view updates. This must be used to add new properties to reactive objects, as Vue cannot detect normal property additions (e.g. `this.myObject.newProperty = 'hi'`). + Lägger till en egenskap på ett reaktivt objekt och säkerställer att den nya egenskapen också är reaktiv, vilket utlöser uppdatering av view. Detta måste användas för att lägga till nya egenskaper på reaktiva objekt eftersom Vue inte kan detektera normala egenskapstillägg (t.ex. `this.myObject.newProperty = 'hi'`). -

The target object cannot be a Vue instance, or the root data object of a Vue instance.

+

Målobjektet kan inte vara en Vue-instans eller det översta dataobjektet av en Vue-instans.

-- **See also:** [Reactivity in Depth](../guide/reactivity.html) +- **Läs även:** [Fördjupning i reaktivitet](../guide/reactivity.html) ### Vue.delete( target, propertyName/index ) From 18c88aa82d632f4b5c8277abb2e5cfa830ef7971 Mon Sep 17 00:00:00 2001 From: Pwntus Date: Wed, 10 Jul 2019 23:18:41 +0200 Subject: [PATCH 13/35] =?UTF-8?q?sp=C3=A5rninglappnig=20>=20sp=C3=A5rnings?= =?UTF-8?q?lappning?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/v2/api/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/v2/api/index.md b/src/v2/api/index.md index 260ff00eed..59c24942b9 100644 --- a/src/v2/api/index.md +++ b/src/v2/api/index.md @@ -164,7 +164,7 @@ type: api - **Användning**: - Sätt detta till `true` för att möjliggöra komponentinitiering, kompilering, rendering och spårninglappning för prestanda i prestanda/tidslinje -panelen i webbläsarens utvecklingsverktyg. Fungerar endast i utvecklingsläge och i webbläsare som stöder [performance.mark](https://developer.mozilla.org/en-US/docs/Web/API/Performance/mark) API:et. + Sätt detta till `true` för att möjliggöra komponentinitiering, kompilering, rendering och spårningslappning för prestanda i prestanda/tidslinje -panelen i webbläsarens utvecklingsverktyg. Fungerar endast i utvecklingsläge och i webbläsare som stöder [performance.mark](https://developer.mozilla.org/en-US/docs/Web/API/Performance/mark) API:et. ### productionTip From 69096d7cf6c531bf678c34f83283057f6b243c77 Mon Sep 17 00:00:00 2001 From: Pwntus Date: Wed, 10 Jul 2019 23:25:48 +0200 Subject: [PATCH 14/35] docs: translate API Vue.delete() --- src/v2/api/index.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/v2/api/index.md b/src/v2/api/index.md index 59c24942b9..05beeb4653 100644 --- a/src/v2/api/index.md +++ b/src/v2/api/index.md @@ -261,25 +261,25 @@ type: api Lägger till en egenskap på ett reaktivt objekt och säkerställer att den nya egenskapen också är reaktiv, vilket utlöser uppdatering av view. Detta måste användas för att lägga till nya egenskaper på reaktiva objekt eftersom Vue inte kan detektera normala egenskapstillägg (t.ex. `this.myObject.newProperty = 'hi'`). -

Målobjektet kan inte vara en Vue-instans eller det översta dataobjektet av en Vue-instans.

+

Målobjektet kan inte vara en Vue-instans eller det översta dataobjektet i en Vue-instans.

- **Läs även:** [Fördjupning i reaktivitet](../guide/reactivity.html) ### Vue.delete( target, propertyName/index ) -- **Arguments:** +- **Argument:** - `{Object | Array} target` - `{string | number} propertyName/index` - > Only in 2.2.0+: Also works with Array + index. + > Endast i 2.2.0+: Fungerar även med Array + index. -- **Usage:** +- **Användning:** - Delete a property on an object. If the object is reactive, ensure the deletion triggers view updates. This is primarily used to get around the limitation that Vue cannot detect property deletions, but you should rarely need to use it. + Radera en egenskap på ett objekt. Säkerställer att raderingen utlöser uppdatering av view om objektet är reaktivt. Detta används primärt för att kringgå begränsningen Vue har med att detektera egenskapsraderingar, men detta lär sällan behövas. -

The target object cannot be a Vue instance, or the root data object of a Vue instance.

+

Målobjektet kan inte vara en Vue-instans eller det översta dataobjektet i en Vue-instans.

-- **See also:** [Reactivity in Depth](../guide/reactivity.html) +- **Läs även:** [Fördjupning i reaktivitet](../guide/reactivity.html) ### Vue.directive( id, [definition] ) From 441c3933473bc7371b7102696751278ccf9e19f0 Mon Sep 17 00:00:00 2001 From: Pwntus Date: Wed, 10 Jul 2019 23:31:45 +0200 Subject: [PATCH 15/35] docs: translate API Vue.directive() --- src/v2/api/index.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/v2/api/index.md b/src/v2/api/index.md index 05beeb4653..17293f4c51 100644 --- a/src/v2/api/index.md +++ b/src/v2/api/index.md @@ -283,16 +283,16 @@ type: api ### Vue.directive( id, [definition] ) -- **Arguments:** +- **Argument:** - `{string} id` - `{Function | Object} [definition]` -- **Usage:** +- **Användning:** - Register or retrieve a global directive. + Registrera eller motta ett globalt direktiv. ``` js - // register + // registrera Vue.directive('my-directive', { bind: function () {}, inserted: function () {}, @@ -301,16 +301,16 @@ type: api unbind: function () {} }) - // register (function directive) + // registrera (funktionsdirektiv) Vue.directive('my-directive', function () { - // this will be called as `bind` and `update` + // detta anropas som `bind` och `update` }) - // getter, return the directive definition if registered + // getter, returnera direktivdefinitionen om den är registrerad var myDirective = Vue.directive('my-directive') ``` -- **See also:** [Custom Directives](../guide/custom-directive.html) +- **Läs även:** [Anpassade direktiv](../guide/custom-directive.html) ### Vue.filter( id, [definition] ) From 5314576b19e835e004994e1746b4b79bba677641 Mon Sep 17 00:00:00 2001 From: Pwntus Date: Wed, 10 Jul 2019 23:34:11 +0200 Subject: [PATCH 16/35] translate API Vue.filter() --- src/v2/api/index.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/v2/api/index.md b/src/v2/api/index.md index 17293f4c51..90d934b7ab 100644 --- a/src/v2/api/index.md +++ b/src/v2/api/index.md @@ -314,25 +314,25 @@ type: api ### Vue.filter( id, [definition] ) -- **Arguments:** +- **Argument:** - `{string} id` - `{Function} [definition]` -- **Usage:** +- **Användning:** - Register or retrieve a global filter. + Registrera eller motta ett globalt filter. ``` js - // register + // registrera Vue.filter('my-filter', function (value) { - // return processed value + // returnera bearbetat värde }) - // getter, return the filter if registered + // getter, returnera filtret om det är registrerat var myFilter = Vue.filter('my-filter') ``` -- **See also:** [Filters](../guide/filters.html) +- **Läs även:** [Filter](../guide/filters.html) ### Vue.component( id, [definition] ) From 9e403c665bbe65421585b8494486d99ecfd30b96 Mon Sep 17 00:00:00 2001 From: Pwntus Date: Wed, 10 Jul 2019 23:45:45 +0200 Subject: [PATCH 17/35] docs: translate API Vue.use() --- src/v2/api/index.md | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/v2/api/index.md b/src/v2/api/index.md index 90d934b7ab..8d1d416bb9 100644 --- a/src/v2/api/index.md +++ b/src/v2/api/index.md @@ -336,41 +336,41 @@ type: api ### Vue.component( id, [definition] ) -- **Arguments:** +- **Argument:** - `{string} id` - `{Function | Object} [definition]` -- **Usage:** +- **Användning:** - Register or retrieve a global component. Registration also automatically sets the component's `name` with the given `id`. + Registrera eller motta en global komponent. Registrering sätter även automatiskt komponentens `name` med det givna `id`. ``` js - // register an extended constructor + // registrera en utvidgad konstruktor Vue.component('my-component', Vue.extend({ /* ... */ })) - // register an options object (automatically call Vue.extend) + // registrera ett alternativobjekt (anropa automatiskt Vue.extend) Vue.component('my-component', { /* ... */ }) - // retrieve a registered component (always return constructor) + // motta en registrerad komponent (returnera alltid konstruktor) var MyComponent = Vue.component('my-component') ``` -- **See also:** [Components](../guide/components.html) +- **Läs även:** [Komponenter](../guide/components.html) ### Vue.use( plugin ) -- **Arguments:** +- **Argument:** - `{Object | Function} plugin` -- **Usage:** +- **Användning:** - Install a Vue.js plugin. If the plugin is an Object, it must expose an `install` method. If it is a function itself, it will be treated as the install method. The install method will be called with Vue as the argument. + Installera en Vue.js plugin (insticksprogram). Om plugin är ett objekt måste den exponera en `install` metod. Om den i själva verket är en funktion kommer den bli behandlad som install-metoden. Install-metoden anropas med Vue som argument. - This method has to be called before calling `new Vue()` + Denna metod måste anropas före man använder `new Vue()`. - When this method is called on the same plugin multiple times, the plugin will be installed only once. + När denna metod anropas på samma plugin flera gånger installeras den bara en gång. -- **See also:** [Plugins](../guide/plugins.html) +- **Läs även:** [Plugins](../guide/plugins.html) ### Vue.mixin( mixin ) From 09198069ee2bf8ed49136765946568c5d494cb1c Mon Sep 17 00:00:00 2001 From: Pwntus Date: Wed, 10 Jul 2019 23:50:37 +0200 Subject: [PATCH 18/35] docs: translate API Vue.mixin() --- src/v2/api/index.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/v2/api/index.md b/src/v2/api/index.md index 8d1d416bb9..5ed1cf3840 100644 --- a/src/v2/api/index.md +++ b/src/v2/api/index.md @@ -374,14 +374,14 @@ type: api ### Vue.mixin( mixin ) -- **Arguments:** +- **Argument:** - `{Object} mixin` -- **Usage:** +- **Användning:** - Apply a mixin globally, which affects every Vue instance created afterwards. This can be used by plugin authors to inject custom behavior into components. **Not recommended in application code**. + Tillämpa en global mixin vilket påverkar varje Vue-instans som skapas hädanefter. Detta kan utnyttjas av pluginutvecklare för att injicera anpassad funktionalitet i komponenter. **Rekommenderas ej i applikationskod**. -- **See also:** [Global Mixin](../guide/mixins.html#Global-Mixin) +- **Läs även:** [Global mixin](../guide/mixins.html#Global-Mixin) ### Vue.compile( template ) From e8f35608758fe4a3241117069a3e52f5753e5a98 Mon Sep 17 00:00:00 2001 From: Pwntus Date: Wed, 10 Jul 2019 23:54:10 +0200 Subject: [PATCH 19/35] docs: translate API Vue.compile() --- src/v2/api/index.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/v2/api/index.md b/src/v2/api/index.md index 5ed1cf3840..3dc45fffb9 100644 --- a/src/v2/api/index.md +++ b/src/v2/api/index.md @@ -385,12 +385,12 @@ type: api ### Vue.compile( template ) -- **Arguments:** +- **Argument:** - `{string} template` -- **Usage:** +- **Användning:** - Compiles a template string into a render function. **Only available in the full build.** + Kompilerar en templatesträng (mallsträng) till en renderingsfunktion. **Endast tillgänglig i fullständig utgåva**. ``` js var res = Vue.compile('
{{ msg }}
') @@ -404,7 +404,7 @@ type: api }) ``` -- **See also:** [Render Functions](../guide/render-function.html) +- **Läs även:** [Renderingsfunktioner](../guide/render-function.html) ### Vue.observable( object ) From 96850e6cb2d62ae097134d2f7c1a611ade1ba040 Mon Sep 17 00:00:00 2001 From: Pwntus Date: Thu, 11 Jul 2019 00:21:40 +0200 Subject: [PATCH 20/35] docs: translate API Vue.observable() --- src/v2/api/index.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/v2/api/index.md b/src/v2/api/index.md index 3dc45fffb9..01e7087c9a 100644 --- a/src/v2/api/index.md +++ b/src/v2/api/index.md @@ -408,16 +408,16 @@ type: api ### Vue.observable( object ) -> New in 2.6.0+ +> Nytt i 2.6.0+ -- **Arguments:** +- **Argument:** - `{Object} object` -- **Usage:** +- **Användning:** - Make an object reactive. Internally, Vue uses this on the object returned by the `data` function. + Gör ett objekt reaktivt. Internt använder Vue detta på objektet som returneras av `data`-funktionen. - The returned object can be used directly inside [render functions](../guide/render-function.html) and [computed properties](../guide/computed.html), and will trigger appropriate updates when mutated. It can also be used as a minimal, cross-component state store for simple scenarios: + Det returnerade objektet kan genast användas i [renderingsfunktioner](../guide/render-function.html) och [computed properties (beräknade variabler)](../guide/computed.html) och kommer utlösa ändamålsenliga uppdateringar vid förändring. Den kan även användas som en minimal lagringsplats på tvärs av komponenter för simpla scenarier: ``` js const state = Vue.observable({ count: 0 }) @@ -431,9 +431,9 @@ type: api } ``` -

In Vue 2.x, `Vue.observable` directly mutates the object passed to it, so that it is equivalent to the object returned, as [demonstrated here](../guide/instance.html#Data-and-Methods). In Vue 3.x, a reactive proxy will be returned instead, leaving the original object non-reactive if mutated directly. Therefore, for future compatibility, we recommend always working with the object returned by `Vue.observable`, rather than the object originally passed to it.

+

I Vue 2.x kommer objektet som skickas till `Vue.observable` bli direkt förändrat så att det är identiskt med det returnerade objektet, vilket [demonstreras här](../guide/instance.html#Data-and-Methods). I Vue 3.x returneras en reaktiv proxy istället, vilket lämnar originalobjektet icke-reaktivt om det förändras direkt. Vi rekommenderar därför att alltid jobba mot det returnerade objektet från `Vue.observable` för framtida kompatibilitet, i motsats till objektet som ursprungligen skickas till den.

-- **See also:** [Reactivity in Depth](../guide/reactivity.html) +- **Läs även:** [Fördjupning i reaktivitet](../guide/reactivity.html) ### Vue.version From e1381b996d25dee5c1b59136d07967bf111e056c Mon Sep 17 00:00:00 2001 From: Pwntus Date: Thu, 11 Jul 2019 00:27:20 +0200 Subject: [PATCH 21/35] docs: translate API Vue.version --- src/v2/api/index.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/v2/api/index.md b/src/v2/api/index.md index 01e7087c9a..934e014d0e 100644 --- a/src/v2/api/index.md +++ b/src/v2/api/index.md @@ -437,9 +437,9 @@ type: api ### Vue.version -- **Details**: Provides the installed version of Vue as a string. This is especially useful for community plugins and components, where you might use different strategies for different versions. +- **Detaljer**: Innehåller versionsnummret till Vue-installationen i textform. Detta är speciellt användbart för communityplugins och komponenter där du kanske använder olika strategier för olika versionsnummer. -- **Usage**: +- **Användning**: ```js var version = Number(Vue.version.split('.')[0]) @@ -449,7 +449,7 @@ type: api } else if (version === 1) { // Vue v1.x.x } else { - // Unsupported versions of Vue + // Saknas stöd för detta versionsnummret av Vue } ``` From 6ff8d1a650396b116cd81a057560ce2e8a2f40aa Mon Sep 17 00:00:00 2001 From: Pwntus Date: Sun, 14 Jul 2019 02:16:09 +0200 Subject: [PATCH 22/35] docs: translate API data --- src/v2/api/index.md | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/src/v2/api/index.md b/src/v2/api/index.md index 934e014d0e..8fd9b5ddb5 100644 --- a/src/v2/api/index.md +++ b/src/v2/api/index.md @@ -453,41 +453,41 @@ type: api } ``` -## Options / Data +## Alternativ / Data ### data -- **Type:** `Object | Function` +- **Typ:** `Object | Function` -- **Restriction:** Only accepts `Function` when used in a component definition. +- **Restriktion:** Accepterar endast `Function` när den används i en komponentdefinition. -- **Details:** +- **Detaljer:** - The data object for the Vue instance. Vue will recursively convert its properties into getter/setters to make it "reactive". **The object must be plain**: native objects such as browser API objects and prototype properties are ignored. A rule of thumb is that data should just be data - it is not recommended to observe objects with their own stateful behavior. + Dataobjektet för Vue-instansen. Vue kommer rekursivt konvertera sina egenskaper till getters/setters för att göra dem "reaktiva". **Detta måste vara ett enkelt objekt**: innebyggda objekt så som objekt från webbläsar-API:er blir ignorerade. Värt att minnas är att data borde edast vara data - det rekommenderas ej att observera objekt med egna tillståndsbeteenden. - Once observed, you can no longer add reactive properties to the root data object. It is therefore recommended to declare all root-level reactive properties upfront, before creating the instance. + Du kan inte längre lägga till reaktiva objekt på dataobjektets toppnivå när det väl är observerat. Det rekommenderas därför att genast deklarera alla reaktiva egenskaper på toppnivå innan instansen skapas. - After the instance is created, the original data object can be accessed as `vm.$data`. The Vue instance also proxies all the properties found on the data object, so `vm.a` will be equivalent to `vm.$data.a`. + När instansen väl har skapats kan det ursprungliga dataobjektet nås genom `vm.$data`. Vue-instansen vidarebefordrar också alla egenskaper i dataobjektet, så `vm.a` motsvarar `vm.$data.a`. - Properties that start with `_` or `$` will **not** be proxied on the Vue instance because they may conflict with Vue's internal properties and API methods. You will have to access them as `vm.$data._property`. + Egenskaper som startar på `_` eller `$` kommer **inte** vidarebefordras på Vue-instansen eftersom de kan strida mot de interna egenskaperna och API-metoderna i Vue. Du måste då nå dem genom `vm.$data._property`. - When defining a **component**, `data` must be declared as a function that returns the initial data object, because there will be many instances created using the same definition. If we use a plain object for `data`, that same object will be **shared by reference** across all instances created! By providing a `data` function, every time a new instance is created we can call it to return a fresh copy of the initial data. + När en **komponent** definieras måste `data` deklareras som en funktion som returnerar det ursprungliga dataobjektet eftersom det kommer vara flera instanser som använder samma definition. Om vi använder ett enkelt objekt för `data` kommer det samma objektet att **delas genom referens** på tvärs av alla instanser som skapas! Genom att göra `data` till en funktion kan vi anropa denna funktion varje gång en ny instans skapas och på så vis få en helt ny kopia av ursprungsdata. - If required, a deep clone of the original object can be obtained by passing `vm.$data` through `JSON.parse(JSON.stringify(...))`. + Om det behövs kan man få en djup-klon av ursprungsobjektet genom att sända `vm.$data` genom `JSON.parse(JSON.stringify(...))`. -- **Example:** +- **Exempel:** ``` js var data = { a: 1 } - // direct instance creation + // skapa en instans direkt var vm = new Vue({ data: data }) vm.a // => 1 vm.$data === data // => true - // must use function when in Vue.extend() + // måste använda en funktion i Vue.extend() var Component = Vue.extend({ data: function () { return { a: 1 } @@ -495,13 +495,13 @@ type: api }) ``` - Note that if you use an arrow function with the `data` property, `this` won't be the component's instance, but you can still access the instance as the function's first argument: + Notera att om du använder en pilfunktion i `data`-egenskapen kommer `this` inte vara komponentinstansen, men du kan fortfarande nå instansen genom det första argumentet: ```js data: vm => ({ a: vm.myProp }) ``` -- **See also:** [Reactivity in Depth](../guide/reactivity.html) +- **Läs även:** [Fördjupning i reaktivitet](../guide/reactivity.html) ### props From 9c3c01411095474302defe5f1920ae921fd543ba Mon Sep 17 00:00:00 2001 From: Pwntus Date: Sun, 14 Jul 2019 02:45:24 +0200 Subject: [PATCH 23/35] docs: translate API props --- src/v2/api/index.md | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/v2/api/index.md b/src/v2/api/index.md index 8fd9b5ddb5..dbdbe76164 100644 --- a/src/v2/api/index.md +++ b/src/v2/api/index.md @@ -505,35 +505,35 @@ type: api ### props -- **Type:** `Array | Object` +- **Typ:** `Array | Object` -- **Details:** +- **Detaljer:** - A list/hash of attributes that are exposed to accept data from the parent component. It has an Array-based simple syntax and an alternative Object-based syntax that allows advanced configurations such as type checking, custom validation and default values. + En lista/hashtabell av attribut som exponeras för att acceptera data från föräldrakomponenten. Den har en enkel array-baserad syntax och en alternativ objekt-baserad syntax som möjliggör avancerad konfiguration så som typkontroll, anpassade valideringar och standardvärden. - With Object-based syntax, you can use following options: - - `type`: can be one of the following native constructors: `String`, `Number`, `Boolean`, `Array`, `Object`, `Date`, `Function`, `Symbol`, any custom constructor function or an array of those. Will check if a prop has a given type, and will throw a warning if it doesn't. [More information](../guide/components-props.html#Prop-Types) on prop types. + Med den objekt-baserade syntaxen kan du använda följande alternativ: + - `type`: kan vara en av följande nativkonstruktörer: `String`, `Number`, `Boolean`, `Array`, `Object`, `Date`, `Function`, `Symbol`, anpassad konstruktörfunktion eller en array av dem. Kommer kontrollera om en prop har den givna typen och kastar annars en varning om den ej har det. [Mer information](../guide/components-props.html#Prop-Types) om prop-typer. - `default`: `any` - Specifies a default value for the prop. If the prop is not passed, this value will be used instead. Object or array defaults must be returned from a factory function. + Definierar ett standardvärde för prop. Om denna prop inte har skickats kommer detta värdet att användas instället. Standardvärden som är objekt eller array måste returneras från en fabriksfunktion. - `required`: `Boolean` - Defines if the prop is required. In a non-production environment, a console warning will be thrown if this value is truthy and the prop is not passed. + Definierar ifrall prop är obligatorisk. I ett icke-produktionsläge kommer en konsollvarning kastas om detta värdet är sant och prop:en inte har skickats. - `validator`: `Function` - Custom validator function that takes the prop value as the sole argument. In a non-production environment, a console warning will be thrown if this function returns a falsy value (i.e. the validation fails). You can read more about prop validation [here](../guide/components-props.html#Prop-Validation). + Anpassad valideringsfuktion som tar prop-värdet som enda argument. I ett icke-produktionsläge kommer en konsollvarning kastas om denna funktion returnerar ett falskt värde (t.ex. ifall valideringen misslyckats). Du kan läsa mera om propvalidering [här](../guide/components-props.html#Prop-Validation). -- **Example:** +- **Exempel:** ``` js - // simple syntax + // simpel syntax Vue.component('props-demo-simple', { props: ['size', 'myMessage'] }) - // object syntax with validation + // objektsyntax med objektvalidering Vue.component('props-demo-advanced', { props: { - // type check + // typkontroll height: Number, - // type check plus other validations + // typkontroll och flera valideringar age: { type: Number, default: 0, @@ -546,7 +546,7 @@ type: api }) ``` -- **See also:** [Props](../guide/components-props.html) +- **Läs även:** [Props](../guide/components-props.html) ### propsData From 116fdefa9452e774118c4a00a95f4bf093e39381 Mon Sep 17 00:00:00 2001 From: Pwntus Date: Sun, 14 Jul 2019 02:49:12 +0200 Subject: [PATCH 24/35] docs: translate API propsData --- src/v2/api/index.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/v2/api/index.md b/src/v2/api/index.md index dbdbe76164..7d517f26e2 100644 --- a/src/v2/api/index.md +++ b/src/v2/api/index.md @@ -459,7 +459,7 @@ type: api - **Typ:** `Object | Function` -- **Restriktion:** Accepterar endast `Function` när den används i en komponentdefinition. +- **Restriktion:** accepterar endast `Function` när den används i en komponentdefinition. - **Detaljer:** @@ -550,15 +550,15 @@ type: api ### propsData -- **Type:** `{ [key: string]: any }` +- **Typ:** `{ [key: string]: any }` -- **Restriction:** only respected in instance creation via `new`. +- **Restriktion:** respekteras endast då en instans skapas med `new`. -- **Details:** +- **Detaljer:** - Pass props to an instance during its creation. This is primarily intended to make unit testing easier. + Skicka props till en instans då den skapas. Detta är främst avsett för att göra enhetstestning enklare. -- **Example:** +- **Exempel:** ``` js var Comp = Vue.extend({ From 89051d7421fc979b9bdec776945e16b2a4fa5a93 Mon Sep 17 00:00:00 2001 From: Pwntus Date: Sun, 14 Jul 2019 02:59:04 +0200 Subject: [PATCH 25/35] docs: translate API computed --- src/v2/api/index.md | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/v2/api/index.md b/src/v2/api/index.md index 7d517f26e2..7817affef5 100644 --- a/src/v2/api/index.md +++ b/src/v2/api/index.md @@ -495,7 +495,7 @@ type: api }) ``` - Notera att om du använder en pilfunktion i `data`-egenskapen kommer `this` inte vara komponentinstansen, men du kan fortfarande nå instansen genom det första argumentet: + Notera att om du använder en pilfunktion i `data`-egenskapen kommer `this` inte vara komponentinstansen, men du kan fortfarande nå instansen genom funktionens första argument: ```js data: vm => ({ a: vm.myProp }) @@ -575,13 +575,13 @@ type: api ### computed -- **Type:** `{ [key: string]: Function | { get: Function, set: Function } }` +- **Typ:** `{ [key: string]: Function | { get: Function, set: Function } }` -- **Details:** +- **Detaljer:** - Computed properties to be mixed into the Vue instance. All getters and setters have their `this` context automatically bound to the Vue instance. + Computed properties (beräknade egenskaper) som kommer bli inkluderade i Vue-instansen. Alla getters och setters har sin `this`-kontext automatiskt bundna till Vue-instansen. - Note that if you use an arrow function with a computed property, `this` won't be the component's instance, but you can still access the instance as the function's first argument: + Notera att ifall du använder en pilfunktion i en computed property kommer `this` inte vara komponentinstansen, men du kan fortfarande nå instansen genom funktionens första argument: ```js computed: { @@ -589,19 +589,19 @@ type: api } ``` - Computed properties are cached, and only re-computed on reactive dependency changes. Note that if a certain dependency is out of the instance's scope (i.e. not reactive), the computed property will __not__ be updated. + Computed properties är cachade och återberäknas endast vid reaktiva beroendeförändringar. Notera att ifall ett specifikt beroende är utanför instansräckvidden (t.ex. inte reaktiv) kommer computed property:en __inte__ bli uppdaterad. -- **Example:** +- **Exempel:** ```js var vm = new Vue({ data: { a: 1 }, computed: { - // get only + // endast get aDouble: function () { return this.a * 2 }, - // both get and set + // både get och set aPlus: { get: function () { return this.a + 1 @@ -618,7 +618,7 @@ type: api vm.aDouble // => 4 ``` -- **See also:** [Computed Properties](../guide/computed.html) +- **Läs även:** [Computed Properties](../guide/computed.html) ### methods From cfc0b6d7b7e09cb46bf45c21058ecab5c64848fc Mon Sep 17 00:00:00 2001 From: Pwntus Date: Sun, 14 Jul 2019 03:04:04 +0200 Subject: [PATCH 26/35] docs: translate API methods --- src/v2/api/index.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/v2/api/index.md b/src/v2/api/index.md index 7817affef5..30af528aa3 100644 --- a/src/v2/api/index.md +++ b/src/v2/api/index.md @@ -622,15 +622,15 @@ type: api ### methods -- **Type:** `{ [key: string]: Function }` +- **Typ:** `{ [key: string]: Function }` -- **Details:** +- **Detaljer:** - Methods to be mixed into the Vue instance. You can access these methods directly on the VM instance, or use them in directive expressions. All methods will have their `this` context automatically bound to the Vue instance. + Metoder som kommer bli inkluderade i Vue-instansen. Du kan nå dessa metoder direkt på VM-instansen, eller använda dem i direktivuttryck. Alla metoder kommer automatiskt att ha sin `this`-kontext bundna till Vue-instansen. -

Note that __you should not use an arrow function to define a method__ (e.g. `plus: () => this.a++`). The reason is arrow functions bind the parent context, so `this` will not be the Vue instance as you expect and `this.a` will be undefined.

+

Notera att __du ej bör använda en pilfunktion då du definierar en metod__ (t.ex. `plus: () => this.a++`). Orsaken är att pilfunktioner binder föräldrakontexten, så `this` kommer inte vara Vue-instansen och `this.a` kommer vara odefinierat.

-- **Example:** +- **Exempel:** ```js var vm = new Vue({ @@ -645,7 +645,7 @@ type: api vm.a // 2 ``` -- **See also:** [Event Handling](../guide/events.html) +- **Läs även:** [Händelsehantering](../guide/events.html) ### watch From d7af6501f59d70b51698c2b1f8f7ca903de44979 Mon Sep 17 00:00:00 2001 From: Pwntus Date: Sun, 14 Jul 2019 03:14:20 +0200 Subject: [PATCH 27/35] docs: translate API watch --- src/v2/api/index.md | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/v2/api/index.md b/src/v2/api/index.md index 30af528aa3..6e98a91e6b 100644 --- a/src/v2/api/index.md +++ b/src/v2/api/index.md @@ -649,13 +649,13 @@ type: api ### watch -- **Type:** `{ [key: string]: string | Function | Object | Array}` +- **Typ:** `{ [key: string]: string | Function | Object | Array}` -- **Details:** +- **Detaljer:** - An object where keys are expressions to watch and values are the corresponding callbacks. The value can also be a string of a method name, or an Object that contains additional options. The Vue instance will call `$watch()` for each entry in the object at instantiation. + Ett objekt där nycklar är uttryck som skall bevakas och värden är motsvarande callbacks. Värdena kan även vara en textsträng till ett metodnamn eller ett objekt som innehåller ytterligare alternativ. Vue-instansen anropar `$watch()` för varje element i objektet vid instansiering. -- **Example:** +- **Exempel:** ``` js var vm = new Vue({ @@ -674,14 +674,14 @@ type: api a: function (val, oldVal) { console.log('new: %s, old: %s', val, oldVal) }, - // string method name + // metodnamn som en textsträng b: 'someMethod', - // the callback will be called whenever any of the watched object properties change regardless of their nested depth + // callback anropas varje gång någon av de bevakade objektegenskaperna ändras, oavsett deras kapslade djup c: { handler: function (val, oldVal) { /* ... */ }, deep: true }, - // the callback will be called immediately after the start of the observation + // callback anropas genast då bevakningen startar d: { handler: 'someMethod', immediate: true @@ -694,16 +694,16 @@ type: api /* ... */ } ], - // watch vm.e.f's value: {g: 5} + // bevaka vm.e.f's värde: {g: 5} 'e.f': function (val, oldVal) { /* ... */ } } }) - vm.a = 2 // => new: 2, old: 1 + vm.a = 2 // => ny: 2, gammal: 1 ``` -

Note that __you should not use an arrow function to define a watcher__ (e.g. `searchQuery: newValue => this.updateAutocomplete(newValue)`). The reason is arrow functions bind the parent context, so `this` will not be the Vue instance as you expect and `this.updateAutocomplete` will be undefined.

+

Notera att __du ej bör använda en pilfunktion då du definierar en watcher__ (t.ex. `searchQuery: newValue => this.updateAutocomplete(newValue)`). Orsaken är att pilfunktioner binder föräldrakontexten, så `this` kommer inte vara Vue-instansen och `this.updateAutocomplete` kommer vara odefinierat.

-- **See also:** [Instance Methods / Data - vm.$watch](#vm-watch) +- **Läs även:** [Instansmetoder / Data - vm.$watch](#vm-watch) ## Options / DOM From ae422bb43a904f6eaded2b9e0e627bb2bd9231bb Mon Sep 17 00:00:00 2001 From: Pwntus Date: Sun, 14 Jul 2019 22:33:21 +0200 Subject: [PATCH 28/35] docs: translate API el --- src/v2/api/index.md | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/v2/api/index.md b/src/v2/api/index.md index 6e98a91e6b..9f0a54d825 100644 --- a/src/v2/api/index.md +++ b/src/v2/api/index.md @@ -705,29 +705,29 @@ type: api - **Läs även:** [Instansmetoder / Data - vm.$watch](#vm-watch) -## Options / DOM +## Alternativ / DOM ### el -- **Type:** `string | Element` +- **Typ:** `string | Element` -- **Restriction:** only respected in instance creation via `new`. +- **Restriktion:** respekteras endast då en instans skapas med `new`. -- **Details:** +- **Detaljer:** - Provide the Vue instance an existing DOM element to mount on. It can be a CSS selector string or an actual HTMLElement. + Förse Vue-instansen ett existerande element att montera sig på. Detta kan vara en CSS-selektor textsträng eller ett HTMLElement. - After the instance is mounted, the resolved element will be accessible as `vm.$el`. + Efter att instansen har monterats kan det valda elementet nås med `vm.$el`. - If this option is available at instantiation, the instance will immediately enter compilation; otherwise, the user will have to explicitly call `vm.$mount()` to manually start the compilation. + Om detta alternativet existerar vid instansiering kommer instansen att genast starta kompilering; annars måste användaren anropa `vm.$mount()` för att manuellt starta kompileringen. -

The provided element merely serves as a mounting point. Unlike in Vue 1.x, the mounted element will be replaced with Vue-generated DOM in all cases. It is therefore not recommended to mount the root instance to `` or ``.

+

Det försedda elementet fungerar endast som en monteringpunkt. Till skillnad från Vue 1.x kommer elementet att ersättas med Vue-genererad DOM i alla tillfällen. Det rekommenderas därför ej att montera toppinstansen på `` eller ``.

-

If neither `render` function nor `template` option is present, the in-DOM HTML of the mounting DOM element will be extracted as the template. In this case, Runtime + Compiler build of Vue should be used.

+

Om varken en `render`-funktion eller ett `template`-alternativ existerar kommer HTML i DOM av monteringselementet att exraheras som template (mall). I dessa tillfällen borde runtime + kompilator-utgåvan av Vue användas.

-- **See also:** - - [Lifecycle Diagram](../guide/instance.html#Lifecycle-Diagram) - - [Runtime + Compiler vs. Runtime-only](../guide/installation.html#Runtime-Compiler-vs-Runtime-only) +- **Läs även:** + - [Lifecycle-diagram](../guide/instance.html#Lifecycle-Diagram) + - [Runtime + kompilator vs. endast runtime](../guide/installation.html#Runtime-Compiler-vs-Runtime-only) ### template From 1b781960ceb0c21635026469742f6dcacf253b74 Mon Sep 17 00:00:00 2001 From: Pwntus Date: Sun, 14 Jul 2019 22:43:08 +0200 Subject: [PATCH 29/35] docs: translate API template --- src/v2/api/index.md | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/v2/api/index.md b/src/v2/api/index.md index 9f0a54d825..2bc3da067e 100644 --- a/src/v2/api/index.md +++ b/src/v2/api/index.md @@ -715,7 +715,7 @@ type: api - **Detaljer:** - Förse Vue-instansen ett existerande element att montera sig på. Detta kan vara en CSS-selektor textsträng eller ett HTMLElement. + Förse Vue-instansen med ett existerande element att montera sig på. Detta kan vara en CSS selektor-textsträng eller ett HTMLElement. Efter att instansen har monterats kan det valda elementet nås med `vm.$el`. @@ -731,21 +731,21 @@ type: api ### template -- **Type:** `string` +- **Typ:** `string` -- **Details:** +- **Detaljer:** - A string template to be used as the markup for the Vue instance. The template will **replace** the mounted element. Any existing markup inside the mounted element will be ignored, unless content distribution slots are present in the template. + En template (mall) i textsträngformat att användas som markup för Vue-instansen. Denna template kommer **ersätta** det monterade elementet. All existerande markup i det monterade elementet kommer bli ignorerat, såvida inte innehållsdistribuerande slots existerar i template. - If the string starts with `#` it will be used as a querySelector and use the selected element's innerHTML as the template string. This allows the use of the common `