Use windom.open() in vue to jump to html files to pass and get parameters

Preface

  • In some projects, you may be using Vue, but you need to open HTML files to complete business functions, such as opening Word to edit documents. In this case, you can use the windom.open() method to achieve this.

Use of windom.open()

  • First, your html file should be placed under the pubilc file, so that the directory it opens is the root directory.

  • Use it in the vue file to pass the parameters you need

window.open(`/word/index.html?name=${
      
      参数}`);
  • html file receiving parameters
window.location.search;

Guess you like

Origin blog.csdn.net/yuan0209/article/details/129970757