Created
June 7, 2019 17:52
-
-
Save Jarmahent/57addfcc1bae6199f0162d32f6db1bf7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
import { db, page_data, admin_user } from "./firebase"; | |
export default { | |
name: "App", | |
firebase: { | |
data: { | |
source: page_data, | |
readyCallback: function() { | |
this.loaded = true; | |
} | |
} | |
}, | |
created() { | |
page_data.once("value").then(data => { | |
this.code = JSON.stringify(data.val().content, null, 2); | |
}); | |
}, | |
methods: { | |
saveData: function() { | |
page_data.set({content: JSON.parse(this.code)}); | |
this.showCodeEditor = false; | |
}, | |
cancel: function(){ | |
this.showAuth = false; | |
this.showCodeEditor = false; | |
}, | |
showLogIn: function(){ | |
this.showAuth = !this.showAuth; | |
} | |
} | |
}; | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment