最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

vue項(xiàng)目實(shí)例中用query傳參如何實(shí)現(xiàn)跳轉(zhuǎn)效果

 更新時(shí)間:2022年10月09日 10:03:08   作者:彧老魔  
這篇文章主要介紹了vue項(xiàng)目實(shí)例中用query傳參如何實(shí)現(xiàn)跳轉(zhuǎn)效果,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。如有錯(cuò)誤或未考慮完全的地方,望不吝賜教

用query傳參實(shí)現(xiàn)跳轉(zhuǎn)效果

vue中已element-ui為例,寫(xiě)帶參跳轉(zhuǎn)很方便

<el-table
                :data="tables"
                style="width: 100%; cursor: pointer"
                :class="tableData.length > 0 ? '' : 'casesList'"
                :cell-style="{'text-align':'center'}"
                :header-cell-style="{'text-align':'center'}"
              >
                <el-button
                  slot="empty"
                  style="margin: 25% auto"
                  type="primary"
                  round
                  @click="Newcase"
                  >新建案件+</el-button
                >
                <el-table-column align="center" label="序號(hào)" width="80" type="index">
                </el-table-column>
                <el-table-column label="案件名稱(chēng)" align="center">
                  <template slot-scope="scope">
                    <div
                      @click="detailed(scope.row)"
                      slot="reference"
                      class="name-wrapper"
                    >
                      <el-tag size="medium">{{ scope.row.name }}</el-tag>
                    </div>
                  </template>
                </el-table-column>
                <el-table-column label="案件說(shuō)明" align="center">
                  <template slot-scope="scope">
                    <span style="margin-left: 10px">{{
                      scope.row.description
                    }}</span>
                  </template>
                </el-table-column>
                <el-table-column label="案件類(lèi)型" align="center">
                  <template slot-scope="scope">
                    <span style="margin-left: 10px">{{
                      scope.row.caseType
                    }}</span>
                  </template>
                </el-table-column>
                <el-table-column label="創(chuàng)建人" align="center">
                  <template slot-scope="scope">
                    <span style="margin-left: 10px">{{
                      scope.row.createUserName
                    }}</span>
                  </template>
                </el-table-column>
                <el-table-column label="創(chuàng)建時(shí)間" width="200" align="center">
                  <template slot-scope="scope">
                    <span style="margin-left: 10px">{{
                      scope.row.createTime
                    }}</span>
                  </template>
                </el-table-column>
                <el-table-column label="更新時(shí)間" width="200" align="center">
                  <template slot-scope="scope">
                    <span style="margin-left: 10px">{{
                      scope.row.modifiedTime
                    }}</span>
                  </template>
                </el-table-column>
                <el-table-column label="操作" width="300" align="center">
                  <template slot-scope="scope">
                    <el-button
                      size="mini"
                      @click="handleEdit(scope.$index, scope.row)"
                      >修改</el-button
                    >
                    <el-button
                      size="mini"
                      type="danger"
                      @click="handleDelete(scope.$index, scope.row)"
                      >刪除</el-button
                    >
                    <el-button
                      size="mini"
                      @click="handleJump(scope.$index, scope.row)"
                      >分析</el-button
                    >
                  </template>
                </el-table-column>
              </el-table>

用后臺(tái)接口取到數(shù)據(jù)渲染到頁(yè)面,element-ui很方便配合它自己封裝的handleJump(scope.$index, scope.row),就可以很輕松的找到你想要的值和精準(zhǔn)的操作每一行。

<script>
export default {
  components: {},
  data() {
    return {};
  },
  //計(jì)算
  computed: {},
  //監(jiān)聽(tīng)
  watch: {},
 
  methods: {
         handleJump(index, row) {
      console.log(index, row);
      console.log(row.id);
      this.$router.push({
        path: "/CaseQueryCanvas",
        query: {data:row },
      });
    },
 
  },
  //方法
  mounted() {},
};
</script>

這里我是已傳對(duì)象的形式進(jìn)行傳值的,到跳轉(zhuǎn)頁(yè)面取值會(huì)比較方便,以免到跳轉(zhuǎn)頁(yè)面還需要截取自己所需的值,比較麻煩。

其中的path是需要傳值的目的地,就是要將值傳到此頁(yè)面,此路徑在

 

query就是你所要傳遞的對(duì)象。

接下來(lái)就是去目的地頁(yè)面接收所傳過(guò)去的參數(shù)

這里我只需要用傳過(guò)去的ID去查找和跳轉(zhuǎn)對(duì)應(yīng)的頁(yè)面,name屬性去顯示在當(dāng)前頁(yè)面上,所以用對(duì)象傳值很方便,需要哪一個(gè)取哪一個(gè)即可。

 這里就只取了傳過(guò)來(lái)的ID,將id賦值給所需對(duì)象傳參跳轉(zhuǎn)相應(yīng)頁(yè)面即可。

而剛剛所說(shuō)的name屬性就被我用來(lái)顯示,拿出來(lái)直接用就行

這樣就完成了傳值和動(dòng)態(tài)顯示,下面上完整代碼,是自己所寫(xiě)的真實(shí)項(xiàng)目,寫(xiě)的有點(diǎn)垃圾大家只看query傳參的部分就行。

傳值頁(yè)面

<template>
  <div style="padding: 20px">
    <div>
      <main class="h-full pb-16 overflow-y-auto">
        <div class="container grid px-6 mx-auto">
          <div style="position: relative">
            <a
              class="
                flex
                items-center
                justify-between
                p-4
                mb-8
                text-sm
                font-semibold
                text-purple-100
                bg-purple-600
                rounded-lg
                shadow-md
                focus:outline-none focus:shadow-outline-purple
              "
              href=""
            >
              <div class="flex items-center">
                <svg
                  class="w-5 h-5 mr-2"
                  fill="currentColor"
                  viewBox="0 0 20 20"
                >
                  <path
                    d="M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 00-1.175 0l-2.8 2.034c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 00.951-.69l1.07-3.292z"
                  ></path>
                </svg>
 
                <span>案件列表</span>
              </div>
            </a>
            <span id="newcanvas" @click="newcanvas">新建案件&nbsp;&nbsp;></span>
          </div>
 
          <div style="display: flex; margin-bottom: 20px">
            <p class="surveyfile">
              <span>案件名稱(chēng):</span
              ><el-input
                v-model="search"
                placeholder="請(qǐng)輸入案件名稱(chēng)"
              ></el-input>
            </p>
            <p class="surveyfile">
              <span class="timeframe">時(shí)間范圍&nbsp;&nbsp;:</span>
              <el-date-picker
                class="shijian"
                v-model="value1"
                type="daterange"
                range-separator="至"
                start-placeholder="開(kāi)始日期"
                end-placeholder="結(jié)束日期"
              >
              </el-date-picker>
            </p>
            <el-button
              type="primary"
              round
              style="margin-left: 40px; padding: 10px 20px"
              @click="Datequery"
              >搜索</el-button
            >
            <el-button round @click="Resetbutton">重置</el-button>
          </div>
          <div class="w-full overflow-hidden rounded-lg shadow-xs">
            <div class="w-full overflow-x-auto">
              <el-table
                :data="tables"
                style="width: 100%; cursor: pointer"
                :class="tableData.length > 0 ? '' : 'casesList'"
                :cell-style="{'text-align':'center'}"
                :header-cell-style="{'text-align':'center'}"
              >
                <el-button
                  slot="empty"
                  style="margin: 25% auto"
                  type="primary"
                  round
                  @click="Newcase"
                  >新建案件+</el-button
                >
                <el-table-column align="center" label="序號(hào)" width="80" type="index">
                </el-table-column>
                <el-table-column label="案件名稱(chēng)" align="center">
                  <template slot-scope="scope">
                    <div
                      @click="detailed(scope.row)"
                      slot="reference"
                      class="name-wrapper"
                    >
                      <el-tag size="medium">{{ scope.row.name }}</el-tag>
                    </div>
                  </template>
                </el-table-column>
                <el-table-column label="案件說(shuō)明" align="center">
                  <template slot-scope="scope">
                    <span style="margin-left: 10px">{{
                      scope.row.description
                    }}</span>
                  </template>
                </el-table-column>
                <el-table-column label="案件類(lèi)型" align="center">
                  <template slot-scope="scope">
                    <span style="margin-left: 10px">{{
                      scope.row.caseType
                    }}</span>
                  </template>
                </el-table-column>
                <el-table-column label="創(chuàng)建人" align="center">
                  <template slot-scope="scope">
                    <span style="margin-left: 10px">{{
                      scope.row.createUserName
                    }}</span>
                  </template>
                </el-table-column>
                <el-table-column label="創(chuàng)建時(shí)間" width="200" align="center">
                  <template slot-scope="scope">
                    <span style="margin-left: 10px">{{
                      scope.row.createTime
                    }}</span>
                  </template>
                </el-table-column>
                <el-table-column label="更新時(shí)間" width="200" align="center">
                  <template slot-scope="scope">
                    <span style="margin-left: 10px">{{
                      scope.row.modifiedTime
                    }}</span>
                  </template>
                </el-table-column>
                <el-table-column label="操作" width="300" align="center">
                  <template slot-scope="scope">
                    <el-button
                      size="mini"
                      @click="handleEdit(scope.$index, scope.row)"
                      >修改</el-button
                    >
                    <el-button
                      size="mini"
                      type="danger"
                      @click="handleDelete(scope.$index, scope.row)"
                      >刪除</el-button
                    >
                    <el-button
                      size="mini"
                      @click="handleJump(scope.$index, scope.row)"
                      >分析</el-button
                    >
                  </template>
                </el-table-column>
              </el-table>
            </div>
            <!-- 新建案件 -->
            <el-dialog
              title="新增案件"
              :visible.sync="ClickaddcaseVisible"
              width="50%"
            >
              <el-form
                :model="ruleForm"
                :rules="rules"
                ref="ruleForm"
                label-width="100px"
                class="demo-ruleForm"
              >
                <el-form-item label="案件名稱(chēng)" prop="name">
                  <el-input
                    v-model="ruleForm.name"
                    maxlength="20"
                    show-word-limit
                    placeholder="請(qǐng)輸入案件名稱(chēng)(必填)"
                  ></el-input>
                </el-form-item>
                <el-form-item label="案件類(lèi)型" prop="Typeofcase">
                  <el-select
                    v-model="ruleForm.Typeofcase"
                    placeholder="請(qǐng)選擇案件類(lèi)型(必填)"
                  >
                    <el-option
                      v-for="item in options"
                      :key="item.code"
                      :label="item.label"
                      :value="item.code"
                    >
                    </el-option>
                  </el-select>
                </el-form-item>
                <el-form-item label="警種" prop="policecategory">
                  <el-input
                    placeholder="請(qǐng)輸入警種"
                    v-model="ruleForm.policecategory"
                  ></el-input>
                </el-form-item>
                <el-form-item label="案件說(shuō)明" prop="Casedescription">
                  <el-input
                    type="textarea"
                    v-model="ruleForm.Casedescription"
                    maxlength="200"
                    show-word-limit
                    placeholder="請(qǐng)輸入案件說(shuō)明(必填)"
                  ></el-input>
                </el-form-item>
                <el-form-item>
                  <el-button @click="ClickaddcaseVisible = false"
                    >取消</el-button
                  >
                  <el-button type="primary" @click="Confirmaddingcases"
                    >確定</el-button
                  >
                </el-form-item>
              </el-form>
            </el-dialog>
            <!-- 修改案件 -->
            <el-dialog
              title="修改案件"
              :visible.sync="Modifythecase"
              width="50%"
            >
              <div class="Clickaddcase" style="width: 90%">
                <div class="Casename">
                  <p>案件名稱(chēng) :</p>
                  <el-input
                    v-model="newtable.name"
                    placeholder="請(qǐng)輸入案件名稱(chēng)(必填)"
                  ></el-input>
                </div>
                <div class="Typeofcase">
                  <p>案件類(lèi)型 :</p>
                  <el-select
                    v-model="newtable.caseType"
                    placeholder="請(qǐng)選擇案件類(lèi)型(必填)"
                    class="Typeofcaseselect"
                  >
                    <el-option
                      v-for="item in options"
                      :key="item.code"
                      :label="item.label"
                      :value="item.code"
                    >
                    </el-option>
                  </el-select>
                </div>
                <div class="policecategory">
                  <p>警種 :</p>
                  <el-input
                    v-model="newtable.policeType"
                    placeholder="請(qǐng)輸入警種"
                  ></el-input>
                </div>
                <div class="Casedescription">
                  <p>案件說(shuō)明 :</p>
                  <el-input
                    type="textarea"
                    :rows="2"
                    placeholder="請(qǐng)輸入案件說(shuō)明(必填)"
                    v-model="newtable.description"
                  >
                  </el-input>
                </div>
              </div>
              <span slot="footer" class="dialog-footer" style="width: 50%">
                <el-button @click="Modifythecase = false">取 消</el-button>
                <el-button type="primary" @click="Modifycasedescription"
                  >確 定</el-button
                >
              </span>
            </el-dialog>
            <div class="block" style="margin-top: 30px">
              <el-pagination
                background
                @size-change="handleSizeChange"
                @current-change="handleCurrentChange"
                :current-page="pageRequestVo.page"
                :page-sizes="[10, 20, 30, 40]"
                :page-size="pageRequestVo.size"
                layout="total, sizes, prev, pager, next, jumper"
                :total="total"
              >
              </el-pagination>
            </div>
          </div>
        </div>
      </main>
    </div>
  </div>
</template>
 
 
 
  <script>
 
export default {
  data() {
    return {
      ruleForm: {
        name: "",
        Typeofcase: "",
        policecategory: "",
        Casedescription: "",
      },
 
      search: "",
      value1: null,
      Modifythecase: false,
      ClickaddcaseVisible: false,
      options: [],
      textarea: "",
      totalElements: null,
      tableData: [],
      pageRequestVo: {
        caseId: null,
        createTimeEnd: null,
        createTimeStart: null,
        name: null,
        page: 1,
        size: 10,
      },
      newtable: {
        name: "",
        caseType: "",
        policeType: "",
        options: [],
        description: "",
      },
      total: 0,
    };
  },
  methods: {
 
    //跳轉(zhuǎn)畫(huà)布
    handleJump(index, row) {
      console.log(index, row);
      console.log(row.id);
      this.$router.push({
        path: "/CaseQueryCanvas",
        query: {data:row },
      });
    },
    //點(diǎn)擊案件名稱(chēng)跳轉(zhuǎn)
    detailed(row) {
      console.log(row);
      // console.log(id);
      this.$router.push({
        path: "/CaseQueryCanvas",
        query: { data:row },
      });
    },
 
 
  created() {},
  //方法
  mounted() {
 
  },
};
</script>
 
<style scope>
.timeframe {
  font-size: 14px;
}
.shijian {
  width: 400px !important;
}
.casesList {
  height: 500px;
}
 
.Casename,
.Typeofcase,
.policecategory,
.Casedescription {
  margin-bottom: 20px;
}
.Typeofcaseselect {
  width: 100%;
}
.dialog-footer {
  display: flex;
  justify-content: space-between;
  margin: auto;
}
.block {
  display: flex;
 
  justify-content: flex-end;
 
  margin-right: 30px;
}
 
.el-pagination.is-background .el-pager li:not(.disabled).active {
  background: #7e3af2;
}
 
.mask-style {
  width: 70%;
 
  margin: 10px auto;
}
#newcanvas {
  position: absolute;
  right: 10px;
  top: 15px;
  color: #fff;
}
.surveyfile {
  display: flex;
  align-items: center;
  margin-left: 20px;
}
.surveyfile span {
  display: inline-block;
  width: 150px;
}
</style>

接收參數(shù)頁(yè)面

<template>
  <div style="padding: 20px">
    <!-- <el-header>Header</el-header> -->
 
    <div>
      <main class="h-full pb-16 overflow-y-auto">
        <div class="container grid px-6 mx-auto">
          <div style="position: relative">
            <a
              class="
                flex
                items-center
                justify-between
                p-4
                mb-8
                text-sm
                font-semibold
                text-purple-100
                bg-purple-600
                rounded-lg
                shadow-md
                focus:outline-none focus:shadow-outline-purple
              "
              href=""
            >
              <div class="flex items-center">
                <svg
                  class="w-5 h-5 mr-2"
                  fill="currentColor"
                  viewBox="0 0 20 20"
                >
                  <path
                    d="M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 00-1.175 0l-2.8 2.034c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 00.951-.69l1.07-3.292z"
                  ></path>
                </svg>
 
                <span>{{this.$route.query.data.name}}案件畫(huà)布列表</span>
              </div>
            </a>
            <span id="newcanvas" @click="newcanvasBtn"
              >新建畫(huà)布 &RightArrow;</span
            >
          </div>
 
          <div style="display: flex; margin-bottom: 20px">
            <p class="surveyfile">
              <span>畫(huà)布名稱(chēng):</span
              ><el-input
                placeholder="請(qǐng)輸入內(nèi)容"
                v-model="pageRequestVo.name"
              ></el-input>
            </p>
            <p class="surveyfile">
              <span style="width: 100px">創(chuàng)建時(shí)間:</span>
              <el-date-picker
                v-model="datetime"
                type="datetimerange"
                range-separator="至"
                start-placeholder="開(kāi)始日期"
                end-placeholder="結(jié)束日期"
              >
              </el-date-picker>
            </p>
            <el-button
              type="primary"
              round
              style="margin-left: 40px"
              @click="searchbtn"
              >搜索</el-button
            >
          </div>
          <div class="w-full overflow-hidden rounded-lg shadow-xs">
            <div class="w-full overflow-x-auto">
              <el-table
                :data="tableData"
                style="width: 100%; cursor: pointer"
                :header-cell-style="{ 'text-align': 'center' }"
                :cell-style="{ 'text-align': 'center' }"
              >
                <el-table-column label="序號(hào)" width="80" align="center">
                  <template slot-scope="scope">
                    <span style="margin-left: 10px">{{
                      scope.row.number
                    }}</span>
                  </template>
                </el-table-column>
                <el-table-column label="畫(huà)布名稱(chēng)" align="center">
                  <template slot-scope="scope">
                    <div
                      @click="detailed(scope.row.id)"
                      slot="reference"
                      class="name-wrapper"
                    >
                      <el-tag size="medium">{{ scope.row.name }}</el-tag>
                    </div>
                  </template>
                </el-table-column>
                <el-table-column label="畫(huà)布描述" align="center">
                  <template slot-scope="scope">
                    <span style="margin-left: 10px">{{
                      scope.row.description
                    }}</span>
                  </template>
                </el-table-column>
                <el-table-column label="創(chuàng)建日期" align="center">
                  <template slot-scope="scope">
                    <span style="margin-left: 10px">{{
                      scope.row.createTime
                    }}</span>
                  </template>
                </el-table-column>
                <el-table-column label="更新時(shí)間" align="center">
                  <template slot-scope="scope">
                    <span style="margin-left: 10px">{{
                      scope.row.modifiedTime
                    }}</span>
                  </template>
                </el-table-column>
                <el-table-column label="操作" width="300" align="center">
                  <template slot-scope="scope">
                    <el-button
                      size="mini"
                      @click="handleEdit(scope.$index, scope.row)"
                      >修改</el-button
                    >
 
                    <el-button
                      size="mini"
                      type="danger"
                      @click="handleDelete(scope.$index, scope.row)"
                      >刪除</el-button
                    >
 
                    <el-button
                      size="mini"
                      @click="historyBtn(scope.$index, scope.row)"
                      >歷史記錄</el-button
                    >
                  </template>
                </el-table-column>
              </el-table>
            </div>
 
            <div class="block" style="margin-top: 30px">
              <el-pagination
                background
                @size-change="handleSizeChange"
                @current-change="handleCurrentChange"
                :current-page="pageRequestVo.page"
                :page-sizes="[10, 20, 30, 40]"
                :page-size="pageRequestVo.size"
                layout="total, sizes, prev, pager, next, jumper"
                :total="totalElements"
              >
              </el-pagination>
            </div>
 
            <el-dialog
              title="修改信息"
              :visible.sync="dialogVisible"
              width="40%"
              center
            >
              <div class="mask-style">
                <p>
                  畫(huà)布名稱(chēng):<el-input
                    v-model="editList.name"
                    placeholder="請(qǐng)輸入畫(huà)布名稱(chēng)"
                    style="width: 80%; margin-bottom: 30px"
                  ></el-input>
                </p>
 
                <p>
                  畫(huà)布描述:<el-input
                    v-model="editList.description"
                    placeholder="請(qǐng)輸入畫(huà)布描述"
                    style="width: 80%"
                  ></el-input>
                </p>
              </div>
 
              <span slot="footer" class="dialog-footer">
                <el-button @click="dialogVisible = false">取 消</el-button>
                <el-button type="primary" @click="editBtn()">確 定</el-button>
              </span>
            </el-dialog>
          </div>
        </div>
      </main>
    </div>
    <el-dialog title="新建畫(huà)布" :visible.sync="dialogVisible1" width="30%">
      <el-input
        v-model="cnavasname"
        placeholder="請(qǐng)輸入畫(huà)布名稱(chēng)"
        style="margin-top: 30px"
      ></el-input>
      <el-input
        v-model="describe"
        placeholder="請(qǐng)輸入畫(huà)布描述"
        style="margin-top: 30px"
      ></el-input>
      <span slot="footer" class="dialog-footer">
        <el-button @click="dialogVisible1 = false">取 消</el-button>
        <el-button type="primary" @click="submitBtn">確 定</el-button>
      </span>
    </el-dialog>
    <!-- <el-footer>Footer</el-footer> -->
  </div>
</template>
 
<script>
import {
  deleteCanvas,
  editCanvas,
  getAddCanvas,
  getCanvasId,
} from "@/apis/operate.js";
import dayjs from "dayjs";
import { CurrentCaseList } from "../../apis/Casemanagement";
export default {
  components: {},
  data() {
    return {
      datetime: null,
      cnavasname: "",
      describe: "",
      dialogVisible1: false,
      totalElements: null,
      tableData: [],
      editList: {
        name: "",
        description: "",
        id: "",
      },
      pageRequestVo: {
        createTimeEnd: null,
        createTimeStart: null,
        name: null,
        page: 1,
        size: 10,
      },
      dialogVisible: false,
    };
  },
  //計(jì)算
  computed: {},
  //監(jiān)聽(tīng)
  watch: {},
 
  methods: {
 
    //案件接收參數(shù)
    Casereceivingparameters() {
      //query對(duì)象傳值
      console.log(this.$route.query.data);
      this.pageRequestVo.caseId=parseInt(this.$route.query.data.id)
      CurrentCaseList(this.pageRequestVo).then((res) => {
        console.log(res);
        this.totalElements = res.data.totalElements;
        //更改時(shí)間
        res.data.content.forEach((item) => {
          item.modifiedTime = dayjs
            .unix(item.modifiedTime)
            .format("YYYY-MM-DD HH:mm");
        });
 
        //創(chuàng)建日期
        res.data.content.forEach((item) => {
          item.createTime = dayjs
            .unix(item.createTime)
            .format("YYYY-MM-DD HH:mm");
        });
        let number = 1;
 
        res.data.content.map((item) => {
          return (item.number = number++);
        });
 
        this.tableData = [...res.data.content];
      });
    },
 
  },
 
  created() {
    this.Casereceivingparameters();
  },
  //方法
  mounted() {},
};
</script>
 
<style>
.block {
  display: flex;
 
  justify-content: flex-end;
 
  margin-right: 30px;
}
 
.el-pagination.is-background .el-pager li:not(.disabled).active {
  background: #7e3af2;
}
 
.mask-style {
  width: 70%;
 
  margin: 10px auto;
}
#newcanvas {
  position: absolute;
  right: 10px;
  top: 15px;
  color: #fff;
}
.surveyfile {
  display: flex;
  align-items: center;
  margin-left: 20px;
}
.surveyfile span {
  display: inline-block;
  width: 150px;
}
</style>

vue使用query傳參,解決跳轉(zhuǎn)回退無(wú)參數(shù)渲染頁(yè)面,無(wú)內(nèi)容的方法(不需使用緩存的技術(shù))

? ? ? this.$router.push({
? ? ? ? name: "goodsDetail",
? ? ? ? query: {
? ? ? ? ? id: id,
? ? ? ? ? goods_type:goods_type
? ? ? ? }
? ? ? });
 mounted(){
      this.proId = this.$route.query.id;//商品id
      this.goods_type = this.$route.query.goods_type;//商品類(lèi)型
}

簡(jiǎn)說(shuō)params和query的區(qū)別

params對(duì)象會(huì)在回退后消失,但是query會(huì)綁在路由后,有路可退

以上為個(gè)人經(jīng)驗(yàn),希望能給大家一個(gè)參考,也希望大家多多支持腳本之家。

相關(guān)文章

  • Vue強(qiáng)制組件重新渲染的方法討論

    Vue強(qiáng)制組件重新渲染的方法討論

    這篇文章給大家詳細(xì)介紹了Vue強(qiáng)制組件重新渲染的正確方法,非常的實(shí)用,有需要的小伙伴可以參考下
    2020-02-02
  • vuex管理狀態(tài)倉(cāng)庫(kù)使用詳解

    vuex管理狀態(tài)倉(cāng)庫(kù)使用詳解

    這篇文章主要介紹了vuex管理狀態(tài)倉(cāng)庫(kù)使用詳解,文中通過(guò)示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)學(xué)習(xí)吧
    2020-07-07
  • 簡(jiǎn)單的三步vuex入門(mén)

    簡(jiǎn)單的三步vuex入門(mén)

    通過(guò)簡(jiǎn)單的三步讓大家對(duì)VUEX快速的入門(mén),本文還介紹了VUEX的最基礎(chǔ)的函數(shù)以及相關(guān)知識(shí)點(diǎn),有興趣的學(xué)習(xí)下。
    2018-05-05
  • vue-resource + json-server模擬數(shù)據(jù)的方法

    vue-resource + json-server模擬數(shù)據(jù)的方法

    本篇文章主要介紹了vue-resource + json-server模擬數(shù)據(jù)的方法,小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,也給大家做個(gè)參考。一起跟隨小編過(guò)來(lái)看看吧
    2017-11-11
  • Vue封裝的可編輯表格插件方法

    Vue封裝的可編輯表格插件方法

    今天小編就為大家分享一篇Vue封裝的可編輯表格插件方法,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。一起跟隨小編過(guò)來(lái)看看吧
    2018-08-08
  • 在vue中阻止瀏覽器后退的實(shí)例

    在vue中阻止瀏覽器后退的實(shí)例

    今天小編就為大家分享一篇在vue中阻止瀏覽器后退的實(shí)例,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。一起跟隨小編過(guò)來(lái)看看吧
    2019-11-11
  • vue-cli2.x項(xiàng)目?jī)?yōu)化之引入本地靜態(tài)庫(kù)文件的方法

    vue-cli2.x項(xiàng)目?jī)?yōu)化之引入本地靜態(tài)庫(kù)文件的方法

    這篇文章主要介紹了vue-cli2.x項(xiàng)目?jī)?yōu)化之引入本地靜態(tài)庫(kù)文件的方法,小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,也給大家做個(gè)參考。一起跟隨小編過(guò)來(lái)看看吧
    2018-06-06
  • vue后臺(tái)返回base64圖片無(wú)法顯示的解決

    vue后臺(tái)返回base64圖片無(wú)法顯示的解決

    這篇文章主要介紹了vue后臺(tái)返回base64圖片無(wú)法顯示的解決方案,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。如有錯(cuò)誤或未考慮完全的地方,望不吝賜教
    2022-06-06
  • 詳細(xì)解讀VUE父子組件的使用

    詳細(xì)解讀VUE父子組件的使用

    這篇文章主要介紹了詳細(xì)解讀VUE父子組件的使用,今天來(lái)講一種子父組件深度耦合的方式,使我們不用額外的創(chuàng)建新的組件,也可以達(dá)到一些效果,下面與你們分享一下
    2023-05-05
  • web前端vue filter 過(guò)濾器

    web前端vue filter 過(guò)濾器

    vue的過(guò)濾器通常用在一些常見(jiàn)的文本格式化,過(guò)濾器可以用在兩個(gè)地方:雙花括號(hào)插值和 v-bind 表達(dá)式。本文給大家介紹了web前端vue filter 過(guò)濾器的相關(guān)知識(shí),感興趣的朋友一起看看吧
    2018-01-01

最新評(píng)論

新兴县| 故城县| 当阳市| 平阴县| 偃师市| 重庆市| 临漳县| 湄潭县| 南华县| 镇原县| 松潘县| 陇南市| 太仆寺旗| 博乐市| 仪征市| 当涂县| 华蓥市| 红河县| 长武县| 安龙县| 玉溪市| 上虞市| 鲁甸县| 来安县| 石泉县| 池州市| 赫章县| 镇原县| 台州市| 无为县| 凭祥市| 石河子市| 广饶县| 陇南市| 泌阳县| 西乌珠穆沁旗| 五大连池市| 宜川县| 越西县| 中超| 大名县|