Hi All,
So Im working on a data service app, and need to make a user settings UI screen. I put some basics, code in the file to test, but for whatever reason I can not get the NcButton to fire.
Here is the line and file,
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
-->
<template>
<div>
<NcButton @click="alert('I am an alert box!')">
Show Settings
</NcButton>
<NcAppSettingsDialog :open.sync="ServiceSettingsDialog" name="Application settings">
<NcAppSettingsSection id="asci-name-1" name="Example name 1">
Some example content
</NcAppSettingsSection>
<NcAppSettingsSection id="asci-name-2" name="Example name 2">
Some more content
</NcAppSettingsSection>
Any ideas what I’m doing wrong here?
Sebastian
Hey @sebastiank .
I have not tested it but I highly guess that the console will show you an error in the click handler. Have a look at the browser console.
You might want to define a method in the Vue component and trigger that. Alternatively, you can emit an event or similar.
Christian
Hey @christianlupus
I found my issue. I accidentally had a nested methods inside methods. Which was causing all the JS code NOT to execute. (Face Plam)
},
props: [],
data() {
return {
ServiceSettingsDialog: false,
}
},
methods: {
methods: {
openServiceSettings() {
this.ServiceSettingsDialog = true
},
closeServiceSettings() {
this.ServiceSettingsDialog = false
},
},
},
}
Thank you for the help!
Sebastian
1 Like
Sorry for not seeing this one.
Hey, no worries, I missed it too.
I would never have guessed that something that minute would completely stopped all the vue code from rendering. It didn’t even through an error when being compiled by npm.
Sebastian
1 Like