I have the following vuejs component. I know that is a pretty simple example, but it does not load on second call i-e when I move forward from one component to second component the html and request initialized and when I back from the second component to the first component and then again move to second component then the html and request not initialize
<template>
<div class="page-top mb-1 mb-3 align-center clearfix">
<h1 class="float-left"> component one </h1>
</div>
<div class="auto-generate-main" style="padding: 60px;">
<div class="auto-generate-inner">
<label for="" class="label block-label"> Amount </label>
<div class="form-group">
<input type="text" id="amount" class="form-control" name="amount" v-model="form.amount" placeholder="Enter an amount." :class="{ 'is-invalid': form.errors.has('amount') }" autocomplete="off"/>
<has-error :form="form" field="amount"></has-error>
</div>
<button class="btn btn-primary float-right" @click="processToSecondComponent">Next</button>
</div>
</div>
</template>
This is second component
<template>
<div>
<div class="page-top mb-1 mb-3 clearfix"><h1 class="float-left">Second Component</h1></div>
<div class="global-main">
<div class="people-management-inner-content">
<div id="initializeHtmlAndRequest ">
</div>
</div>
</div>
<script>
<script type="text/javascript" src="https://example.test/PGWHPCPlugin.js"></script>
export default {
data() {
return {
banks: [],
form: new Form({
amount: 0,
}),
};
},
mounted() {
PGWHPCAcct.initialize("initializeHtmlAndRequest");
},
}
</script>
question from:
https://stackoverflow.com/questions/65914783/load-html-and-initialize-request-on-vuejs-component 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…