Skip to content

Commit

Permalink
Use global store
Browse files Browse the repository at this point in the history
  • Loading branch information
dtinth committed Apr 3, 2020
1 parent 57e5d33 commit e972466
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
6 changes: 3 additions & 3 deletions options.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ <h2 class="text-2xl text-bbeeff mt-6 mb-4">Language settings</h2>
id="first_language"
type="text"
placeholder="Enter second language"
v-model="settings.language1"
v-model="store.settings.language1"
/>
</div>
</div>
Expand All @@ -50,7 +50,7 @@ <h2 class="text-2xl text-bbeeff mt-6 mb-4">Language settings</h2>
id="second_language"
type="text"
placeholder="Enter second language"
v-model="settings.language2"
v-model="store.settings.language2"
/>
</div>
</div>
Expand All @@ -59,7 +59,7 @@ <h2 class="text-2xl text-bbeeff mt-6 mb-4">Language settings</h2>
<div class="w-1/3"></div>
<div>
<button
@click="save"
@click="store.save"
class="shadow text-090807 focus:shadow-outline focus:outline-none font-bold py-2 px-4 rounded"
:class="[changed ? 'bg-d7fc70' : 'bg-8b8685']"
type="button"
Expand Down
10 changes: 7 additions & 3 deletions options.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
Vue.config.productionTip = false
Vue.config.devtools = false

var vm
var vm = new Vue({
el: '#app',
data: {
store: null,
},
})

function main({ defaultSettings, settings }) {
vm = new Vue({
el: '#app',
vm.store = new Vue({
data: {
savedSettings: JSON.parse(JSON.stringify(settings)),
settings,
Expand Down

0 comments on commit e972466

Please sign in to comment.