In XML's action, how can JS method be invoked into Vue?

  • xml Code
    <krpano>

    <action name="xmltest">

    js("callvue('I want to call the method in vue')"); // is this right ??

    </action>

    </krpano>

    Vue code


    export default {


    data() {
    return {

    }
    },
    mounted() {
    embedpano({
    swf: 'krpano/krpano.swf',
    xml: 'krpano/krpano.xml',
    target: "pano",
    id: "krpanoSWFObject",
    html5: "only",
    passQueryParameters: true,
    onready: this.krpanoReady
    })
    },
    methods: {
    krpanoReady() {
    let panoDom = document.getElementById('krpanoSWFObject')
    this.$krp.init(panoDom)
    }
    }
    }


    new Vue({


    data() {

    return{
    _krpano: null
    }

    },
    methods: {
    init(krDom) {
    this._krpano = krDom
    console.log(this._krpano)
    this._krpano.call("xmltest)")
    },
    callvue(msg){
    console.log(msg)
    }
    }
    })

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!