The Nuggets website is made by vue ssr, and its data is not put into window.__INITIAL_STATE__, how to do it.

such as the title, the recent project will also be done with vue ssr, and then seo put forward a request, that is, hope that the data will not be put into _ INITAL_STATE_ . After looking at the Nuggets, it should be put into < div id= "jjis" style= "display:none;" data-state= "data" < / div > under
, how can I change it?

May.06,2022

when rendering on the server, just take out the context.state data. Then encrypt and inject it into the page. Just fine.

        
        
     // store
    let renderState = JSON.stringify(context.state);
    // 
    renderState = CryptoJS.encrypt(renderState);
    // dom
    let newString = JSON.stringify(appString);
    newString = newString.replace(/data-store-kans-cce-group/g, renderState);
    newString = JSON.parse(newString);
    
    
    
    const kanId = document.getElementById('kans-store-only-id');
    if (kanId) {
        const orginData = kanId.getAttribute('data-state');
        let decryptData = JSON.parse(CryptoJS.decrypt(orginData));
        console.log(typeof decryptData);
        if (typeof decryptData == 'string') {
            decryptData = JSON.parse(decryptData);
        }
        if (decryptData) {
            store.replaceState(decryptData);
        } else {
            throw ('store error');
        }
Menu