|
@@ -84,13 +84,11 @@ export default {
|
|
mounted() {
|
|
mounted() {
|
|
const editor = document.getElementById(`editor_${this.id}`)
|
|
const editor = document.getElementById(`editor_${this.id}`)
|
|
editor.oncontextmenu = function(e) {
|
|
editor.oncontextmenu = function(e) {
|
|
- console.log(11111)
|
|
|
|
// 取消默认的浏览器自带右键 很重要!!
|
|
// 取消默认的浏览器自带右键 很重要!!
|
|
e.preventDefault()
|
|
e.preventDefault()
|
|
|
|
|
|
// 获取我们自定义的右键菜单
|
|
// 获取我们自定义的右键菜单
|
|
var menu = document.querySelector('#menu')
|
|
var menu = document.querySelector('#menu')
|
|
- console.log(e)
|
|
|
|
// 根据事件对象中鼠标点击的位置,进行定位
|
|
// 根据事件对象中鼠标点击的位置,进行定位
|
|
menu.style.left = e.clientX + 'px'
|
|
menu.style.left = e.clientX + 'px'
|
|
menu.style.top = e.clientY + 'px'
|
|
menu.style.top = e.clientY + 'px'
|
|
@@ -99,7 +97,6 @@ export default {
|
|
menu.style.width = '125px'
|
|
menu.style.width = '125px'
|
|
}
|
|
}
|
|
editor.onclick = function(e) {
|
|
editor.onclick = function(e) {
|
|
- console.log(2222, e)
|
|
|
|
console.log('第几列', e.target.cellIndex + 1, '第几行', e.target.parentNode.rowIndex + 1)
|
|
console.log('第几列', e.target.cellIndex + 1, '第几行', e.target.parentNode.rowIndex + 1)
|
|
const ForeColor = document.queryCommandValue('ForeColor') // 字体颜色
|
|
const ForeColor = document.queryCommandValue('ForeColor') // 字体颜色
|
|
const FontSize = document.queryCommandValue('FontSize') // 字体大小
|
|
const FontSize = document.queryCommandValue('FontSize') // 字体大小
|