小编Fil*_*sta的帖子

子 div 单击事件的意外行为

我为 adiv和 child定义了不同的点击事件span

<div 
  @click.prevent="changeView(value.key)" 
  v-if="value.key != 'Document'" 
  class="panel panel-primary" 
  v-for="(value, key, index) in myList"
>
  <div class="panel-body quote">
    <span 
      @click="removeSection(index,key)" 
      class="pull-right glyphicon glyphicon-remove text-info above"
    ></span>
    <p>{{value.key}}</p>
  </div>
</div>
Run Code Online (Sandbox Code Playgroud)

每次我单击父级时,div它都会打开我期望的部分。每次我点击关闭span它都会删除我的部分。但是,它也会打开一个我不想要的模式。

我想尝试在该部分之外定义元素,但我不确定如何定义。我也尝试使用z-index,但我不知道这是否是一个好的解决方案。

我如何处理点击行为,以便当我点击关闭元素时它不会打开模态?

html javascript css twitter-bootstrap vue.js

4
推荐指数
1
解决办法
420
查看次数

字体大小的 OpenXML 奇怪行为

我正在使用 dll 来创建方法,该方法为我生成基于​​传递的参数创建段落的逻辑:

例如在我的 C# 代码中,我有这个:

    // document permission title
    DocRun accessTypeTitle  = new DocRun();
    Run permissionTitle = accessTypeTitle.createParagraph("DOCUMENT ACCESS", PARAGRAPHCOLOR,FONTSIZETEXT,DEFAULTFONT);
Run Code Online (Sandbox Code Playgroud)

我的 dll 上有我的方法来执行逻辑:

 public class DocRun
    {
        public Run createParagraph(String text, String colorVal, String fontSize,String font)
        {
            Run run = new Run() { RsidRunProperties = "00C53974" };

            RunProperties runProperties = new RunProperties();
            RunFonts runFonts = new RunFonts() { Ascii = font, HighAnsi = font, EastAsia = "Segoe UI", ComplexScript = font };
            Color color = new Color() { Val …
Run Code Online (Sandbox Code Playgroud)

c# xml asp.net openxml asp.net-web-api

3
推荐指数
1
解决办法
1070
查看次数

从asp.net Web API下载文件

我正在尝试从asp.net Web API下载文件(.docx)。

因为我已经在服务器中有一个文档,所以我将路径设置为现有文档的路径,然后按照stackoverflow上的提示进行操作:

docDestination是我的路。

   HttpResponseMessage result = new HttpResponseMessage(HttpStatusCode.OK);
    var stream = new FileStream(docDestination, FileMode.Open, FileAccess.Read);
    result.Content = new StreamContent(stream);
    result.Content.Headers.ContentType = new MediaTypeHeaderValue("application/vnd.openxmlformats-officedocument.wordprocessingml.document");
    return result;
Run Code Online (Sandbox Code Playgroud)

之后,在我的客户端,我尝试执行以下操作:

    .then(response => {
            console.log("here lives the response:", response);
            var headers = response.headers;
            var blob = new Blob([response.body], { type: headers['application/vnd.openxmlformats-officedocument.wordprocessingml.document'] });
            var link = document.createElement('a');
            link.href = window.URL.createObjectURL(blob);
            link.download = "Filename";
            link.click();
        }
Run Code Online (Sandbox Code Playgroud)

这就是我的回应

响应

我得到什么:

我得到什么

有什么帮助吗?

c# asp.net file download asp.net-web-api

3
推荐指数
2
解决办法
1万
查看次数

无法访问动作vuex中的vue资源

大家好,我正在vuex一侧的动作中尝试执行一个请求,但出现此错误:

Cannot read property '$http' of undefined
Run Code Online (Sandbox Code Playgroud)

我在main.js文件中以这种方式设置vue资源:

import Vue from 'vue'
import VueResource from 'vue-resource'
import VueRouter from 'vue-router'
import App from './App.vue'
import {routes} from './routes';
import {store} from './store/store';
import VModal from 'vue-js-modal'

Vue.use(VModal)
Vue.use(VueResource);
Vue.use(VueRouter);

const router = new VueRouter({
  routes
});

new Vue({
  el: '#app',
  store,
  router,
  render: h => h(App)
})
Run Code Online (Sandbox Code Playgroud)

然后在商店:

addStyle(state,newStyleObj) {
    console.log(newStyleObj);
    var vm = this;
    this.$http.post('http://localhost:16339/api/Styles/PostStyle/', newStyleObj)
        .then(response => {
            state.tableStyles = response.body;
            console.log(state.tableStyles)
            console.log(response.body)
        }, error => {
            console.log(error); …
Run Code Online (Sandbox Code Playgroud)

javascript vue.js vue-resource vuex vuejs2

2
推荐指数
2
解决办法
5088
查看次数

p是一个变量但是像一个类型一样使用

我正在使用OpenXML和C#来构建应用程序.我认为这是一个与C#相关的常见错误,而不是其他东西.

我想pforeach循环范围之外访问,所以我将其指定为全局变量,但是我收到此错误:

p是一个变量但是像一个类型一样使用

Paragraph p = new Paragraph();
foreach (p in myIEnumerable){
    /* Do something with p */
}
Run Code Online (Sandbox Code Playgroud)

c# asp.net

0
推荐指数
1
解决办法
2151
查看次数