zoukankan      html  css  js  c++  java
  • vue打印使用插件:vue-print-nb

    一、安装

    npm install vue-print-nb –save

    二、注册

    import Print from 'vue-print-nb'
    Vue.use(Print);

    三、使用

    页面中使用,给需要打印的容器加一个id,打印按钮传入这个id

    <div id="printMe" style="background:red;">
            <p>葫芦娃,葫芦娃</p>
            <p>一根藤上七朵花 </p>
            <p>小小树藤是我家 啦啦啦啦 </p>
            <p>叮当当咚咚当当 浇不大</p>
            <p> 叮当当咚咚当当 是我家</p>
            <p> 啦啦啦啦</p>
            <p>...</p>
            <div class="describle">
              <el-form :model="form" :rules="rules" ref="from" class="demo-ruleForm">
                <el-form-item label="姓名:" prop="name">
                  <el-input v-model="form.name"></el-input>
                </el-form-item>
                <el-form-item label="描述:" prop="describle">
                  <el-input
                    :disabled="detail"
                    type="textarea"
                    :rows="4"
                    :maxlength="2000"
                    placeholder=""
                    v-model="form.describle">
                  </el-input>
                </el-form-item>
              </el-form>
            </div>
        </div>
     
        <button v-print="'#printMe'">Print local range</button>
  • 相关阅读:
    VMware coding Challenge: Coin Toss Betting
    Lintcode: k Sum II
    Lintcode: Interleaving Positive and Negative Numbers
    Lintcode: Insert Node in a Binary Search Tree
    Amazon OA
    Leetcode: Best Time to Buy and Sell Stock IV
    Leetcode: Reverse Words in a String II
    Leetcode: Repeated DNA Sequence
    Leetcode: Rotate Array
    VMware coding Challenge:Date of Weekday
  • 原文地址:https://www.cnblogs.com/zwh0910/p/14984717.html
Copyright © 2011-2022 走看看