mount & format

本文介绍如何在Linux环境下使用mkfs命令对磁盘进行格式化,并演示了具体的命令用法,包括使用不同文件系统类型的示例,以及如何将格式化后的磁盘分区挂载到指定目录。

mkfs.vfat /dev/block/mmcblk1

mkdir /local

mount -t vfat /dev/block/mmcblk1 /local/

 

      Linux下有一条mkfs命令,相当于format,可以对磁盘进行文件系统制作操作(或者说格式化)。命令的语法为:

  mkfs -t 文件系统类型 /dev/设备名

  如要把/dev/sda1格式为reiserfs格式,使用以下命令:

  mkfs -t reiserfs /dev/sda1

  当然,也可以使用mkfs.fstype命令来格式化磁盘,其中的fstype为文件系统名,如reiserfs文件系统的格式化命令为mkfs.reiserfs。上面上面那条命令的相应版本为:

      mkfs.reiserfs /dev/sda1

import { h, createApp, ref } from 'vue' import A4Page from '@/components/A4Page/index.vue' import moment from "moment"; export const createTempComponentAndGenerateImage = function (data) { console.log(data) return new Promise((resolve, reject) => { // 创建隐藏的 DOM 容器 const container = document.createElement('div') container.style.position = 'absolute' container.style.right = '-200px' container.style.top = '0' container.style.backgroundColor = 'red' container.style.zIndex = 99999 document.body.appendChild(container) // 创建 ref const a4PageRef = ref(null) // 定义自定义事件处理函数 const handleCustomEvent = (payload) => { console.log('接收到 A4Page 组件的自定义事件:', payload) // 可以在这里执行后续逻辑 } const dataFormat = (formatData) => { let meetingTime = '', compereList = '', userList = '', attendList = '', absenteeList = '', recorderList = ''; // 处理会议时间 if (formatData.meetingTime) { meetingTime = moment(formatData.meetingTime).format("YYYY-MM-DD HH:mm") } // 处理主持人字段 if (formatData.compereList && formatData.compereList.length > 0) { compereList = formatData.compereList.map(item => item.userName).join(',') } // 处理及记录人字段 if (formatData.recorderList && formatData.recorderList.length > 0) { recorderList = formatData.recorderList.map(item => item.userName).join(',') } // 处理参会人员字段 if (formatData.userList && formatData.userList.length > 0) { userList = formatData.userList.map(item => item.userName).join(',') } // 处理实到人员字段 if (formatData.attendList && formatData.attendList.length > 0) { attendList = formatData.attendList.map(item => item.userName).join(',') } // 处理缺席人员字段 if (formatData.absenteeList && formatData.absenteeList.length > 0) { absenteeList = formatData.absenteeList.map(item => { if (item.reason) { return `${item.userName}(${item.reason})` } else { return `${item.userName}` } }).join(',') } return { meetingTypeField: formatData.meetingTypeField, // 会议类型 meetingTheme: formatData.meetingTheme, // 主题 meetingTime, // 时间 meetingAddr: formatData.meetingAddr, // 地点 compereList, // 主持人 recorderList, // 记录人 userList, // 参会人员 attendList, // 实到人员 absenteeList, // 缺席人员 observer: formatData.observer, // 列席人员 meetingContent: formatData.meetingContent // 会议内容 } } // 创建临时组件(直接使用 A4Page) const TempComponent = { setup () { return () => h(A4Page, { // 1. 绑定 ref ref: a4PageRef, // 2. 传入 props props: { pageData: { ...dataFormat(data) } }, // 3. 绑定自定义事件(注意命名方式为 onEventName) onCustomEvent: handleCustomEvent }) } } // 创建 Vue 应用并挂载组件 const app = createApp(TempComponent) const instance = app.mount(container) // 模拟组件挂载后执行的逻辑 setTimeout(() => { // 此时可以访问组件实例 if (a4PageRef.value) { // console.log('A4Page 实例:', a4PageRef.value) // 假设 A4Page 中有方法 generateContent,可以调用它 if (typeof a4PageRef.value.generateContent === 'function') { a4PageRef.value.generateContent() } } // 此处你可以调用 html2canvas 来截图 // import html2canvas from 'html2canvas' // html2canvas(container).then(canvas => { // resolve(canvas.toDataURL()) // }) // 模拟成功返回 resolve('组件已渲染完成') }, 100) }) } 这样写在A4Page中的props获取不到数据
08-15
import { h, createApp, ref, nextTick } from 'vue' import A4Page from '@/components/A4Page/index.vue' import moment from "moment"; export const createTempComponentAndGenerateImage = function (data) { console.log(data) return new Promise((resolve, reject) => { // 创建隐藏的 DOM 容器 const container = document.createElement('div') container.style.position = 'absolute' container.style.right = '0px' container.style.top = '0' container.style.backgroundColor = 'red' container.style.zIndex = 99999 document.body.appendChild(container) // 创建 ref const a4PageRef = ref(null) // 定义自定义事件处理函数 const getBlodData = (payload) => { console.log('接收到 A4Page 组件的自定义事件:', payload) // 可以在这里执行后续逻辑 } const dataFormat = (formatData) => { let meetingTime = '', compereList = '', userList = '', attendList = '', absenteeList = '', recorderList = ''; // 处理会议时间 if (formatData.meetingTime) { meetingTime = moment(formatData.meetingTime).format("YYYY-MM-DD HH:mm") } // 处理主持人字段 if (formatData.compereList && formatData.compereList.length > 0) { compereList = formatData.compereList.map(item => item.userName).join(',') } // 处理及记录人字段 if (formatData.recorderList && formatData.recorderList.length > 0) { recorderList = formatData.recorderList.map(item => item.userName).join(',') } // 处理参会人员字段 if (formatData.userList && formatData.userList.length > 0) { userList = formatData.userList.map(item => item.userName).join(',') } // 处理实到人员字段 if (formatData.attendList && formatData.attendList.length > 0) { attendList = formatData.attendList.map(item => item.userName).join(',') } // 处理缺席人员字段 if (formatData.absenteeList && formatData.absenteeList.length > 0) { absenteeList = formatData.absenteeList.map(item => { if (item.reason) { return `${item.userName}(${item.reason})` } else { return `${item.userName}` } }).join(',') } return { meetingTypeField: formatData.meetingTypeField, // 会议类型 meetingTheme: formatData.meetingTheme, // 主题 meetingTime, // 时间 meetingAddr: formatData.meetingAddr, // 地点 compereList, // 主持人 recorderList, // 记录人 userList, // 参会人员 attendList, // 实到人员 absenteeList, // 缺席人员 observer: formatData.observer, // 列席人员 meetingContent: formatData.meetingContent // 会议内容 } } // 创建临时组件(直接使用 A4Page) const TempComponent = { setup () { return () => h(A4Page, { // 1. 绑定 ref ref: a4PageRef, // 2. 传入 props pageData: dataFormat(data), // 3. 绑定自定义事件(注意命名方式为 onEventName) getBlodData: getBlodData }) } } // 创建 Vue 应用并挂载组件 const app = createApp(TempComponent) const instance = app.mount(container) // // 模拟组件挂载后执行的逻辑 // setTimeout(() => { // // 此时可以访问组件实例 // if (a4PageRef.value) { // console.log('A4Page 实例:', a4PageRef.value) // // 假设 A4Page 中有方法 generateContent,可以调用它 // if (typeof a4PageRef.value.initA4Page === 'function') { // // a4PageRef.value.initA4Page() // nextTick(() => { // console.log(a4PageRef.value.initA4Page) // }) // } // } // // 此处你可以调用 html2canvas 来截图 // // import html2canvas from 'html2canvas' // // html2canvas(container).then(canvas => { // // resolve(canvas.toDataURL()) // // }) // // 模拟成功返回 // resolve('组件已渲染完成') // }, 100) }) },在这个案例使用 MutationObserver 来完善组件
08-15
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值