我想创建一个带有顶部导航栏、中间区域和页脚的全高布局。顶部导航和页脚应始终分别位于顶部和底部。我设法创建的布局看起来有点像这样:
我实现了这个:
<section class="hero is-fullheight">
<div class="hero-head">
<the-navbar></the-navbar>
</div>
<div class="hero-body">
<div class="container">
<dashboard/>
</div>
</div>
<div class="hero-foot">
<tab-navigation></tab-navigation>
</div>
</section>
Run Code Online (Sandbox Code Playgroud)
现在的问题是,当我<dashboard/>在 hero-body 中有其他元素(如一长串框)时,全高布局丢失,使站点长于显示高度。如何使 hero-body div 可滚动?我尝试添加,overflow: auto;但这不起作用
我的 MediaRecorder API 遇到了一个非常奇怪的问题,过去两天我一直无法解决这个问题。
这个简化的示例工作得很好,当我单击 Chrome UI“停止共享”按钮时,一切都会适当停止:
desktopStream = await navigator.mediaDevices.getDisplayMedia({
video: true,
audio: true,
});
let rec = new MediaRecorder(desktopStream, {
mimeType: "video/webm; codecs=vp8,opus",
});
rec.onstop = async () => {
desktopStream.getTracks().forEach((s) => s.stop());
desktopStream = null;
//blobs.push(MediaRecorder.requestData());
blob = new Blob(blobs, {
type: "video/webm",
});
};
Run Code Online (Sandbox Code Playgroud)
然而事实并非如此,它会继续录制(或者某些 MediaTrack 继续运行,不完全确定):
desktopStream = await navigator.mediaDevices.getDisplayMedia({
video: true,
audio: true,
});
voiceStream = await navigator.mediaDevices.getUserMedia({
video: false,
audio: true,
});
// this is the culprit, when commented everything works as expected …Run Code Online (Sandbox Code Playgroud) 我有很多像这样的图像,需要批量处理:
我想要完成的是裁剪掉每一侧的边框,但这里有一个问题:修剪不起作用,因为图像每个角的颜色不是黑色而是白色,所以我尝试裁剪每边距约 5 个像素。我已经编写了一些代码来做到这一点,但似乎在某个地方出现了错误,导致了有趣的、镜像的和错误裁剪的图像:
function cropLayerToBounds(){
var layer = activeDocument.activeLayer; //Grab the currently selected layer
// get height and width
var actualHeight = layer.bounds[2]-layer.bounds[0]; //Grab the height
var actualWidth = layer.bounds[3]-layer.bounds[1]; //Grab the width
// calculate desired height and width
var desiredHeight = actualHeight - 5;
var desiredWidth = actualWidth - 5;
// not sure if necessary
var doc = app.activeDocument;
var halfWidth = (desiredWidth/2);
var halfHeight = (desiredHeight/2);
var centerX = (doc.width/2);
var centerY = (doc.height/2);
// error seems …Run Code Online (Sandbox Code Playgroud) 我正在尝试解决一个继承问题,其中派生类Snake继承自LivingThing - > Animal - > Reptile,但是,当我没有添加virtual void crawl()到类LivingThing时,编译器说error: no member named 'crawl' in 'LivingThing'.现在我不想在LivingThing中实现一个特定于Snakes的虚拟空白.
#include <iostream>
class LivingThing
{
public:
void breathe()
{
std::cout << "I'm breathing as a living thing." << std::endl;
}
virtual void crawl() {} //dont' want this
};
class Animal : virtual public LivingThing
{
public:
void breathe()
{
std::cout << "I'm breathing as an animal." << std::endl;
}
};
class Reptile : virtual public LivingThing
{
public:
void crawl()
{ …Run Code Online (Sandbox Code Playgroud) 我正在尝试编写一个带有自定义选项的 vue 插件。我遵循官方 vue 指南(https://v2.vuejs.org/v2/guide/plugins.html)来执行此操作,但找不到定义自定义选项的方法。这些选项应该由普通的 javascript 读取,然后导出一个由 vue 组件使用的对象。
我的文件夹结构是这样的:
/src
factory.js
CustomComponent.vue
Run Code Online (Sandbox Code Playgroud)
工厂.js
import Vue from "vue";
import ImgixClient from "imgix-core-js";
var imgixClient = new ImgixClient({
domain: CUSTOM_OPTION_URL <-- important bit
domain: Vue.prototype.$imgixBaseUrl //tried it like this
});
export { imgixClient };
Run Code Online (Sandbox Code Playgroud)
我已经尝试通过在安装方法中使用 Vue.prototype 来设置这个自定义位,但似乎无法让它工作
export function install(Vue, options) {
if (install.installed) return;
install.installed = true;
Vue.prototype.$imgixBaseUrl = options.baseUrl;
Vue.component("CustomComponent", component);
}
Run Code Online (Sandbox Code Playgroud)